]> Cypherpunks repositories - gostls13.git/commit
cmd/go: scan $PATH to find version list in NewerToolchain
authorRuss Cox <rsc@golang.org>
Tue, 30 May 2023 17:28:56 +0000 (13:28 -0400)
committerGopher Robot <gobot@golang.org>
Wed, 31 May 2023 15:15:19 +0000 (15:15 +0000)
commitd59926ec7e5bf709265afc17680ef720e9110696
treee963b8b75928f4698c466beb9f0e83465423e595
parentbfa3284f9b3af76030d8058ae22e3d212637a286
cmd/go: scan $PATH to find version list in NewerToolchain

NewerToolchain needs a list of candidate toolchains.
Currently it always consults the module version list, using the network.
When GOTOOLCHAIN=path, it should probably not do this,
both because =path implies we don't want to use the network
and because not every released version will be in $PATH.
Instead, scan $PATH to find the available versions.

For #57001.

Change-Id: I478612c88d1504704a3f53fcfc73d8d4eedae493
Reviewed-on: https://go-review.googlesource.com/c/go/+/499296
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Bypass: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Auto-Submit: Russ Cox <rsc@golang.org>
src/cmd/go/internal/toolchain/path_none.go [new file with mode: 0644]
src/cmd/go/internal/toolchain/path_plan9.go [new file with mode: 0644]
src/cmd/go/internal/toolchain/path_unix.go [new file with mode: 0644]
src/cmd/go/internal/toolchain/path_windows.go [new file with mode: 0644]
src/cmd/go/internal/toolchain/toolchain.go
src/cmd/go/testdata/script/gotoolchain_path.txt