-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go: should go get deduce semantic import versioning when GO111MODULE is off? #27430
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
This is effectively the library equivalent of #24250 (from both an implementation and docs perspective) |
I don't think this actually has much to do with #24250: that issue is about what happens in module mode (and does not modify |
FWIW, there is already a difference in instructions: users of a library in module mode will generally not need to run
|
One final note: any change here would either require backports or introduce behavior in |
The module vs non-module import path magic is necessarily incomplete. You cannot use a go command in GOPATH mode and pretend to have full support for semantic import paths. The special case we added is limited, to avoid ambiguity. The limitation is:
This does not apply to anything else but that special case. In particular it does not apply to any command line usage, not to go get, not to go list, not to go anything. It's just not a goal to try to make GOPATH mode "more like" module mode. I think that will lead to more confusion than anything. The GOPATH-mode name for that package does not have a v18 in it. |
What version of Go are you using (
go version
)?1.11
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?All
What did you do?
GO111MODULE=off go get github.com/google/go-github/v18/github
What did you expect to see?
Go downloads the library into my GOPATH ignoring the v8 suffix.
What did you see instead?
Summary
go install
is also smart enough to remove vX when installing a go binary.What makes go-get an exception?
Impact
If things stay the same way, all libraries like github.com/google/go-github will have to have two instructions for their users to download their library. Something like this:
Of course, you don't need to do go-get with Go Modules but the point is all the same: having two different installation/import instructions.
The text was updated successfully, but these errors were encountered: