cmd/go: behavior of @latest is confusing #32846
Labels
FrozenDueToAge
modules
NeedsFix
The path to resolution is known, but the work has not been done.
release-blocker
Milestone
In the Go 1.13 cycle, we made a couple of changes to
go get -u
:get -u
equivalent to applying@latest
to dependencies recursively.-u
and@latest
parallel to-u=patch
and@patch
.get -u
not downgrade from versions newer than the latest tagged release (cmd/go:list -u -m
andget -u
suggest downgrades from pseudo-versions afterlatest
#30634).Those changes individually makes sense, but combined they produce a counter-intuitive result: an explicit
go get foo@latest
does not downgrade to the latest release, when it arguably should. That makes issues like #32805 more subtle to diagnose, because commands likego get golang.org/x/tools/gopls@latest
are unexpectedly sensitive to the initial state.I talked with @jayconrod and @rsc about this result, and we have a consensus about what to do about it. The current plan (for Go 1.13!) is:
@upgrade
suffix, with the meaning “@latest
, but only if newer than the active version”.-u
without arguments apply@upgrade
(instead of@latest
) to the named arguments and their dependencies.-u=latest
(as it was in Go 1.12), so that the supported arguments to-u
are only those whose behavior depends on the active version.@latest
as an explicit suffix, with its meaning from Go 1.12 (always the latest release version, even if that is a downgrade from the currently active version).go get
without an explicit suffix:go1.13beta1
) behavior of-u=patch
, which implicitly adds the@patch
suffix.go1.13beta1
) behavior when-u
is unset, which upgrades (but does not downgrade) only the named arguments.@upgrade
suffix instead of@latest
.@jayconrod has volunteered to implement this fix.
CC @thepudds @myitcv @leitzler @hyangah
The text was updated successfully, but these errors were encountered: