]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.21] cmd/go: download 1.X.0 instead of 1.X during toolchain upgrade.
authorSam Thanawalla <samthanawalla@google.com>
Thu, 18 Apr 2024 21:01:06 +0000 (21:01 +0000)
committerCherry Mui <cherryyz@google.com>
Fri, 10 May 2024 15:28:56 +0000 (15:28 +0000)
commit77cfa2904491e5138294a10a4a3e07ac6269e1a7
treefd26f57abed5d139813f791e4d8be83071e52a5c
parent752b009010df021c45f620e683ec062d22b552bf
[release-branch.go1.21] cmd/go: download 1.X.0 instead of 1.X during toolchain upgrade.

This CL modifies the download behavior when downloading a toolchain for 1.21+. Previously, Go would attempt to download 1.X when upgrading the toolchain which would cause the download to fail for 1.21+ since 1.X is an invalid toolchain. We will attempt to download 1.X.0 since that's likely what the user intended.

Additionally, we will also now provide a better error message when the
user provides a language version instead of a toolchain version for
1.21+.

For #66175
For #62278

Fixes #67235

Change-Id: I28f894290a19d8e3cd220e9d70aeca8f4447e5a1
Reviewed-on: https://go-review.googlesource.com/c/go/+/580217
Reviewed-by: Michael Matloob <matloob@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
(cherry picked from commit 27ed85d4d1702e868730ab6ea2ad6326988c615c)
Reviewed-on: https://go-review.googlesource.com/c/go/+/583797
src/cmd/go/internal/toolchain/select.go
src/cmd/go/testdata/script/gotoolchain_issue66175.txt [new file with mode: 0644]