-
Notifications
You must be signed in to change notification settings - Fork 17.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/go: go env GOMOD should not download newer toolchain
It is not neccessary to download a newer toolchain to display the path to GOMOD or GOWORK. Fixes: #61455 Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest,gotip-windows-amd64-longtest Change-Id: I0b031651ad9bfeb5565361ecaff6908640ccf9c8 Reviewed-on: https://go-review.googlesource.com/c/go/+/581275 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Matloob <matloob@golang.org>
- Loading branch information
1 parent
8960925
commit 8c0da42
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
env TESTGO_VERSION=go1.500 | ||
env TESTGO_VERSION_SWITCH=mismatch | ||
|
||
# go env GOMOD should not trigger a toolchain download | ||
cd $GOPATH/mod | ||
go env GOMOD | ||
stdout mod[/\\]go.mod | ||
! stderr 'go: toolchain go1.500 invoked to provide go1.700' | ||
|
||
# go env GOWORK should not trigger a toolchain download | ||
cd $GOPATH/work | ||
go env GOWORK | ||
stdout work[/\\]go.work | ||
! stderr 'go: toolchain go1.500 invoked to provide go1.700' | ||
|
||
-- $GOPATH/mod/go.mod -- | ||
module example.com | ||
|
||
go 1.700 | ||
|
||
-- $GOPATH/work/go.work -- | ||
module example.com | ||
|
||
go 1.700 |