-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go: ability to list available major versions of a module #26286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
There is a more general case of the “converting a project” use-case: it is very similar to “upgrading a project to a new major version”. At some point we may want some sort of mode ( We probably shouldn't actually implement that mode at this point in time, but we can at least consider how |
For legacy concerns this is a duplicate of #26238, and the fix for that issue will start showing legacy v2 v3 etc as if they were "versions" of v1. For non-legacy concerns (you're using x and want to find out that x/v2 exists) I think that's beyond the scope of the go command. So closing as duplicate / out of scope. |
I hope this will be reconsidered. I think major versions being developed and maintained as if they are separate projects is the exception, not the rule. It wouldn't surprise me if hiding the availability of new major versions from developers who are querying for out of date dependencies contributes to a hesitance to bump major versions at all, even when semver semantics demands it. |
@bcmills |
@R-omk, note that this issue is closed, and we do not normally track closed issues. Since different major versions have different import paths (and, presumably, incompatible APIs), it does not seem feasible in general to build automation tools that can upgrade across major versions without additional metadata. (But see #32816 for a related proposal for additional metadata.) |
Picking up discussion from https://go-review.googlesource.com/c/vgo/+/122075#message-2f083e869e098fd047f0f846690e3c0b8c9dd191:
There are two that I've come across so far:
example.com/blah
, happens to bev >= 2
. If you're converting a project that does not have a well known dependency manager file that tells vgo the dependency version is, say,2.4.0
, then you need to discover the latest major version (because that's almost certainly what you want) in order to either adjust import paths orvgo get ...@vX
mvdan.cc/sh/syntax
. Now arguably I'm still thinking in terms of "old" Go import paths. No doubt we'll need to add something to godoc.org to list major versions etc, but until we get there I needed to see what major versions were available in order that I could choose the latest. (I think we can ignore the fact thatmvdan.cc/sh/syntax
has itself not been converted to be vgo-aware).In both cases, especially for custom import paths, this involves a couple of lookups via curl, github etc. Not impossible, but if we had this as part of the vgo command that would help.
/cc @rsc @bcmills
The text was updated successfully, but these errors were encountered: