-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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: fail if the user tries to modify the GOMOD environment variable #51217
Comments
Open question; if one does the equivalent of In other words: to ensure we don't error out when we don't really have to, we could only error if |
Perhaps! I have also argued in the past that we should actually allow the user to actually change the “main module” for a |
I'd also be fine with that :) |
Is this available to be worked on? I'd love to pick this up as a new contributor. 😃 |
GOMOD was previously silently ignored. now fails if the user tries to modify the GOMOD environment variable and it is not the same as the module file that would be used. Fixes golang#51217
Change https://go.dev/cl/395915 mentions this issue: |
See #51171 (comment). The user likely wants to either use
-modfile
, orcd
into the right directory to enter or leave a module. Right now, a command likeGOMOD=foo.mod go list
will happily ignoreGOMOD=foo.mod
.cc @bcmills @matloob
The text was updated successfully, but these errors were encountered: