Open mcandre opened 1 year ago
CC @bcmills @matloob
Note that installing multiple packages from different modules in a single command is not the same as doing it via separate commands. Each go install
or go build
invocation results in a single build context, i.e. a single MVS resolution to find all modules to download and packages to build.
I personally run many go install pkg@latest &
commands and then wait
for all of them. This doesn't mix their dependency versions via MVS, the concurrency works fine thanks to file locking in the build cache, and I don't really notice the overhead of running cmd/go many times.
Agreed that the UX is perhaps not great, but the current restriction is there for a good reason, and lifting it without a second thought will cause confusion and unintended consequences.
I would like to be able to run:
Like I can with other common package managers (apt, yum, brew, cargo).
However, Go currently has this policy prohibiting this invocation. So I have to instead write down the same package commands in a longer boilerplate:
Can we please remove the current restriction against asking
go install
to request separate modules and versions per run?No, I don't want to use an alias or other shim. That introduces fragility and vendor locks provisioning scripts.
When
go mod
eventually standardizes built-in support for pinning dev dependencies, then that would somewhat mitigate the need for this feature ingo install
. But this feature would still serve as a good complement togo mod
, regardless.