-
Notifications
You must be signed in to change notification settings - Fork 18k
dl/internal/version: not setting goroot #30126
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
You may need to run |
right... forgot to mention I did |
Did you run |
Never downloaded
|
Are you setting |
Nope, only set GOPATH nothing more. |
OHHH the windows installer set GOROOT under system variables and I didn't checked there. Still one would assume |
In general, Go installations nowadays should not set up GOROOT. It is inferred from the location of the If you do specify a GOROOT via an env var, it's always used directly. So if your system sets GOROOT, you'll also have to set it up when calling
So in this case, I'd say this is not a bug; you should either not have GOROOT set up, or you should set it up when calling |
If it's decided that there's nothing to do here I'm fine with that. Should I file a new report for the official windows installer setting GOROOT? |
I'd do that; see https://golang.org/doc/go1.10#goroot. Setting it is usually harmless, but can be confusing when one uses multiple Go versions, like you're trying to do. |
I've also sent https://go-review.googlesource.com/c/go/+/161758, as I still found pieces of the official documentation which recommeded setting up GOROOT. |
Looks like this is tracked in the new issue. Closing. |
@agnivade not exactly, they are related yes but quite different. This issue is about whether x/dl/version should ignore a set GOROOT as the point of x/dl/version is to use a specific Go version. |
x/dl/version just installs a go distribution. And the Go distribution will always use a GOROOT env var if it is specifically set. I don't think there is any bug here with x/dl/version. |
What version of Go are you using (
go version
)?1.12beta2 but irreverent
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?What did you do?
In an effort to reproduce the issue reported in #30117
I ran
go get golang.org/dl/gotip
followed bygotip run .
on the code described in#30117 (comment)
What did you expect to see?
No output
What did you see instead?
.\test.go:16:86: syntax error: unexpected semicolon, expecting expression
Setting GOROOT to the proper path gives the expected result.
The text was updated successfully, but these errors were encountered: