]> Cypherpunks repositories - gostls13.git/commit
cmd/go: adjust pruning and switch toolchain when needed in 'go mod tidy'
authorBryan C. Mills <bcmills@google.com>
Tue, 30 May 2023 20:43:50 +0000 (16:43 -0400)
committerGopher Robot <gobot@golang.org>
Sat, 3 Jun 2023 00:53:46 +0000 (00:53 +0000)
commit3fd867cecc2b31c767f8a60f49ac4138dea69d0f
tree4d06507ac59ad5c9efd759a7c84b2653da060ac5
parent77786d90fae21f526caaddd23c887a2a7233a299
cmd/go: adjust pruning and switch toolchain when needed in 'go mod tidy'

'go mod tidy' may resolve an imported package by added a dependency
that requires a higher 'go' version, which may activate graph pruning
(if the version goes from below go 1.16 to above it), and may even
require switching to a newer toolchain (if the version is not
supported by the current one).

For #57001.

Change-Id: Ic8e9b87d5979b3a6d1ee70f1f2bf2eea46b1bb0d
Reviewed-on: https://go-review.googlesource.com/c/go/+/499676
Reviewed-by: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Bryan Mills <bcmills@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
src/cmd/go/internal/modcmd/tidy.go
src/cmd/go/internal/modget/get.go
src/cmd/go/internal/modload/buildlist.go
src/cmd/go/internal/modload/import.go
src/cmd/go/internal/modload/init.go
src/cmd/go/internal/modload/load.go
src/cmd/go/testdata/script/mod_import_toolchain.txt [new file with mode: 0644]
src/cmd/go/testdata/script/mod_tidy_version_tooold.txt [new file with mode: 0644]
src/cmd/go/testdata/script/work.txt