Skip to content
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

cmd/go: `go help get` should show module-get not GOPATH get #37103

Open
rogpeppe opened this issue Feb 7, 2020 · 2 comments
Open

cmd/go: `go help get` should show module-get not GOPATH get #37103

rogpeppe opened this issue Feb 7, 2020 · 2 comments

Comments

@rogpeppe
Copy link
Contributor

@rogpeppe rogpeppe commented Feb 7, 2020

$ go version
go version go1.14rc1 linux/amd64

Running go help get prints the help for the GOPATH usage. As modules are now the preferred approach, I think that go help get should be changed to produce the current go help module-get output and the current page be moved togo help gopath-get.

@jayconrod

This comment has been minimized.

Copy link
Contributor

@jayconrod jayconrod commented Feb 7, 2020

go help get shows either go help module-get or go help gopath-get depending on whether modules are enabled. So if GO111MODULE is auto or not set, and you're outside a module, it will show the GOPATH version. I think it's the only command that works that way.

IMO, it's good to be consistent with module mode. Perhaps though we should show a note at the top indicating which version you're looking at?

@rogpeppe

This comment has been minimized.

Copy link
Contributor Author

@rogpeppe rogpeppe commented Feb 7, 2020

IMO, it's good to be consistent with module mode. Perhaps though we should show a note at the top indicating which version you're looking at?

I think so... I have to say I was very surprised by the help output being context-dependent. I tend to run go help in an arbitrary directory because I thought it didn't matter.

Maybe include a sentence at the top of the help, e.g.

Module mode is currently enabled so this is the help for the module-aware version of "go get".
To see the GOPATH version, use "go help gopath-get".

?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.