Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
proposal: cmd/go: 'go install' should install executables in module mode outside a module #40276
Authors: Jay Conrod, Daniel Martí
Last Updated: 2020-08-10
Design doc: CL 243077
Authors of executables need a simple, reliable, consistent way for users to
These problems lead authors to write complex installation commands such as:
We propose augmenting the
To eliminate redundancy and confusion, we also propose deprecating and removing
With these restrictions, users can install executables using consistent commands.
With this change,
Thanks for the proposal!
Would it also be accurate to say that the go.mod being used as the main module is that of the module being built rather than no "main" module? Erroring on replaces is then simply a consequence of the implementation preventing replaces from being respected because we consider the module the "main". If the intention was not to have a main module, one might expect replaces to be ignored just like go get does today outside of a module. Regardless on how
That's not quite the intent: there will actually be no main module.
In an earlier iteration on #30515, I suggested that
There is some use for
I think we are on the same page here then regardless!
Based on discussion in https://groups.google.com/g/golang-tools/c/BRCgqwWLwoY/m/pKuttL9cAwAJ and on Slack, I'd like to take this in a different direction, so I've updated CL 243077 and the copy above.
Instead of adding
PTAL and comment on CL 243077 if you have any thoughts. This would be a significant change, but it would be good to have a clear separation of responsibility for