-
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
proposal: cmd/go: GOWORK env var should be off by default #54577
Comments
If you |
So what you're saying that:
May be different than:
??? |
Those two commands have always been different - try it on a Go module using replace directives, for example. |
I have tried to use |
This is certainly a duplicate of the rejected #51967 – but some months have passed and people have been using
go.work
in real life projects.One of the great thing about Go's build tools is that you in most cases can do a
go install
in a random Go project and get a fully working executable.With
GOWORK=on
as a default, that is no longer the case:go.work
file committed to CVS, then that file will be used for module resolution..gitignore
then you will get a different build compared to some other person who clones and builds your project.I see arguments in #51967 that you should really control this with Make scripts and similar, which is an argument I find odd. The production build is where the defaults should be directed and, again, one beauty of Go's build tools is the simplicity of just doing
go install
.A related issue #53502 is discussing whether
go.work
should be committed to CVS or not, a question that might have been possible to answer ifGOWORK=off
was the default.The final argument in the #51967 thread was:
The big difference here is that the foot gun now is invisible.
With replace directives we had a well defined situation of "development replace directives should be temporary and never be committed to CVS". It took some care to live by that, and I have certainly shot myself in the foot more than once, but the current situation is that I have to either 1) Not use go.work files or 2) Create Make files for all of my projects (or some other tool to set
GOWORK=off
), which I would need to remember to use myself and document so others also remembers not to just do the simplego install
.The ideal situation would be to be able to turn on GOWORK when I'm doing development, e.g.
GOWORK=on code .
The text was updated successfully, but these errors were encountered: