-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: improve diagnostics for mod subcommands within $GOPATH/src #26365
Comments
@davecheney looks like you're running these commands from within your In which case, take a look through @rsc's answer in golang-dev: https://groups.google.com/d/msg/golang-dev/a5PqQuBljF4/tYBmxfF4BgAJ You'll need to set |
Fair enough. Thanks for the answer.
… On 13 Jul 2018, at 19:46, Paul Jolly ***@***.***> wrote:
@davecheney looks like you're running these commands from within your GOPATH?
In which case, take a look through @rsc's answer in golang-dev:
https://groups.google.com/d/msg/golang-dev/a5PqQuBljF4/tYBmxfF4BgAJ
You'll need to set GO111MODULE=on to force module mode if you want to work with modules inside your GOPATH.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Maybe a better answer is to expand the error text to explain that when inside gopath you need to set an extra env var.
… On 13 Jul 2018, at 23:36, Paul Jolly ***@***.***> wrote:
@rsc @bcmills is it worth adding GO111MODULE to go env to help in these sorts of situations?
Feels like that might be a very common first question we'll ask people.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I suspect we should do both of those things. 🙂 |
We should also show a helpful error for failed builds when a go.mod file was found and modules are off because of GOPATH. |
Change https://golang.org/cl/124708 mentions this issue: |
Should be much improved now. Please reopen if you still run into confusing behavior. |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?% go version
go version devel +8a330454dc Fri Jul 13 03:53:00 2018 +0000 darwin/amd64
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?What did you do?
What did you expect to see?
Not a failure
What did you see instead?
All
go mod
commands reportThe text was updated successfully, but these errors were encountered: