Skip to content
This repository has been archived by the owner on Feb 3, 2018. It is now read-only.

Change SourceManager.ListVersions() to return []PairedVersion #202

Closed
sdboyer opened this issue Mar 22, 2017 · 0 comments
Closed

Change SourceManager.ListVersions() to return []PairedVersion #202

sdboyer opened this issue Mar 22, 2017 · 0 comments

Comments

@sdboyer
Copy link
Owner

sdboyer commented Mar 22, 2017

Currently, SourceManager.ListVersions() returns a []Version, but every current vcs-backed implementation is actually returning a []PairedVersion, just with the elements masquerading as Version (which works because PairedVersion composes Version).

I did this originally because I wanted to design against the possibility that some future source implementations might not have PairedVersions to offer. However, this has been misleading for folks working on dep, and because we can't convert slice types, it just ends up being a general PITA.

So, it'd be better just to have SourceManager.ListVersions() return a []PairedVersion, and in the unlikely event there is a source type in the future that has no revisions, they can just return an empty string for it. Implementations can treat the empty string as a special value and act accordingly.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant