-
Notifications
You must be signed in to change notification settings - Fork 17.5k
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: misleading warning on GOROOT == GOPATH in module mode #47889
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 |
Guys you must seriously consider to produce a comprehensible, complete and well organized documentation and you want to speak also to beginner not only to internal engineering teams I worked with many languages compiled or intepreted but I cannot believe that GO was born without a decent dependencies management tools at the early stages, it sounds like a big oversight or a language was born in 1990. This could have happened to Java or C++ but not to GO , not in 2009 I read many discussions about GOPATH, go.mod, GOROOT, import path, and bla bla .... those will be recognized by people as battle arenas not confortable place, this could be frustrating for US to see people fighting Documentation cannot rise to the level of using the word "ecosystem" before stopping to be a patch work ! believe me, just see their facial expressions when they read the doc To be clear I am not speaking about the power of the GO language but about the way doc is organized and made understandable by common people like me I am sure a beginner cannot find a simple page where GOROOT is explained with its default !!! and worse not to understand that it cannot be the same as GOPATH wasting a lot of time The simple fact this discussion exists is POC something is not happening as you wanted ! Please. Become aware of this I am very interested in learning go but don't make me feel like I'm swimming against the current of a river Didn't we need a language easy to understand ?? so spend time to have a decent doc |
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/protoc-gen-go@v1.5.2
.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: