-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go: when a line is set GOPROXY= in the go/env
file then GOPROXY is treated as is non-empty
#62485
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
|
I appreciate pointing out The bigger issue is that the error message i received didn't match the behavior. In fact I did the I still think there is at least one (if not two) bugs here.
So at very least that error is misleading
This didn't happen on Go 1.20.7 and only showed up when I upgraded to Go 1.21.0 Can you please comment on the entire issue? @seankhliao |
the defaults are now in GOROOT/go.env, so an empty value corresponds to clearing the values set by the defaults, leaving you with no value set. |
So is the problem with the GOPROXY checking or at the very least this error message? This error message states that "empty string" should be ok right and in go.env it is an empty string.
Also is there a use case for setting any of the values with no value set? You cannot do the same with os environment variables: This works fine. So there is a mismatch between how they work in the file vs os level environment variables.
|
I know you probably go through a lot of issues, but I am pretty disappointed with the terse answers and seemingly ignoring half of the issue. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes. I belive this issue is only present on the latest release.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I am using
go env -w GOPROXY=
to try to remove ago/env
variable (set it back to default). It updatedgo/env
file with an entry ofGOPROXY=
.I then try to use something that needs to proxy like
go install -v github.com/cweill/gotests/[email protected]
What did you expect to see?
Go should download and install the package with the default GOPROXY settings
What did you see instead?
I think there is probably two potential bugs here:
go env -w
go/env
file if the entry exists but is empty, treat it as empty (potentially not a bug but suprising?)The text was updated successfully, but these errors were encountered: