-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go: misleading warning on GOROOT == GOPATH in module mode #47889
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
Setting |
I think issues reported here still hold:
|
Looks like none of the commands in module mode check check this |
We should fix this. The install directory should not be set to We should also mention adding I'd recommend against installing anything in |
Can GOROOT == GOPATH be an error instead of just a warning? |
export GOROOT=/usr/local/go This eventually works for me without an error |
@bcmills This is in the 1.18 milestone; time to move to 1.19? Thanks. |
Is this something an external contributor can pick up? I'd like to work on this. Thanks |
@danishprakash Of course. |
Thank you. when upgrading from 1.19 to 1.20 it helped |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I was installing
go install github.com/golang/protobuf/[email protected]
.Inside a fresh system I did:
In another fresh system I did:
What did you expect to see?
As you see, setting
GOPATH
is critical for getting binary installation into/usr/local/go/bin
instead of/root/go/bin
. Without it, it does not work. So the warning sayingGOPATH set to GOROOT (/usr/local/go) has no effect
is misleading. SettingGOPATH
has a pretty dramatic effect.What did you see instead?
I have seen the warning saying
GOPATH set to GOROOT (/usr/local/go) has no effect
and I assumed I can just remove settingGOPATH
but it turns out that is not true. It has an effect.I think this is important because installation instructions only talk about setting
export PATH=$PATH:/usr/local/go/bin
, but without settingGOPATH
. So installed binaries go into/root/go/bin
which is not inPATH
based on the installation instructions.The text was updated successfully, but these errors were encountered: