proposal: cmd/go: allow go get
to choose versions based on the go version constraints
#59886
Labels
FeatureRequest
GoCommand
cmd/go
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Proposal
Milestone
With extended forwards compatibility feature (#57001), the
go
line in go.mod will prescribe the minimum go version required to compile the go module. If the work module saysgo 1.27
but a dependency saysgo 1.28
, the work module should update itsgo.mod
to require at leastgo 1.28
.https://go.googlesource.com/proposal/+/master/design/57001-gotoolchain.md#effect-in-dependencies
For library module maintainers who want to have better control of their minimum go version requirements, dependency update can be rather challenging. They have to pick the dependency version carefully to avoid bumping up their own modules' go version because one of their dependencies chose to bump their go version in their latest release.
We can think of various ways of helping users choose the right version such as
go list -m --versions
to present the minimum required go version for each version.However, querying the requirement individually doesn't scale well when there are many dependencies.
It would be nice if the
go get
has an option to compute and choose the latest versions compatible with the given go version requirement.The text was updated successfully, but these errors were encountered: