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

Closed
rogpeppe opened this issue Feb 7, 2020 · 3 comments
Closed

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

rogpeppe opened this issue Feb 7, 2020 · 3 comments
Labels
Documentation FrozenDueToAge GoCommand cmd/go NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone

Comments

@rogpeppe
Copy link
Contributor

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
Copy link
Contributor

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?

@jayconrod jayconrod added Documentation GoCommand cmd/go NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. labels Feb 7, 2020
@jayconrod jayconrod added this to the Backlog milestone Feb 7, 2020
@rogpeppe
Copy link
Contributor Author

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".

?

@seankhliao
Copy link
Member

I believe this is done (though the sentence is at the bottom)

@golang golang locked and limited conversation to collaborators Nov 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Documentation FrozenDueToAge GoCommand cmd/go NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Projects
None yet
Development

No branches or pull requests

4 participants