You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Does this issue reproduce with the latest release?
What did you do?
go install email@example.com firstname.lastname@example.org
What did you expect to see?
It should install both binaries without issue.
What did you see instead?
go install: email@example.com: all arguments must have the same version (@v6.4.1)
This used to work in the pre-mod days - I could install multiple unrelated binaries from local paths without issue. This seems like an arbitrary and unnecessary restriction. I shouldn't need to run the go command multiple times.
The text was updated successfully, but these errors were encountered:
To eliminate ambiguity about which module versions are used in the build, the arguments must satisfy the following constraints:
All arguments must refer to packages in the same module at the same version.
Making it work for multiple modules at different versions was considered during the design of this feature, but it was decided that installing unrelated commands from different modules will need multiple go install cmd@version invocations. Note that it is possible to install multiple commands from a single module version in one invocation.
I'll close this because the go command is working as intended and documented, but feel free to reopen or comment if I've missed something.
@dmitshur Definitely I think the order of checks (same version and same module) should be reversed. Because right now the error message implies that if goimports and counterfeiter were coincidentally the same version then it would work, which makes it seem especially arbitrary.
Hrm. We can tell that the versions are different in this case without doing any lookups on the network or in the module cache. I suppose that we could technically prove that the two packages are from separate modules in this case too, but in general that's trickier if their paths overlap.