aboutsummaryrefslogtreecommitdiff
path: root/go.env
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2023-05-23 12:37:01 -0400
committerRuss Cox <rsc@golang.org>2023-05-23 18:06:37 +0000
commita6a25869f07beeca8d4a2098d9f896a8a10f5b1e (patch)
tree6d2d4f9ca36ed1449ee763ad9723ff583a528cdd /go.env
parent807cce479f38c84b0bca63db80f64e4700d8643c (diff)
downloadgo-a6a25869f07beeca8d4a2098d9f896a8a10f5b1e.tar.gz
go-a6a25869f07beeca8d4a2098d9f896a8a10f5b1e.zip
cmd/go: set default GOTOOLCHAIN in GOROOT/go.env
As part of the work for #57179 we moved configurable defaults to GOROOT/go.env, so that packagers don't have to modify source code to change those defaults. Since packagers may want to modify GOTOOLCHAIN's default, move it to go.env too. This CL modifies 'go env' to print GOTOOLCHAIN by default. It also refines CL 496957 from yesterday to recognize any env var in either go.env or the user go/env, not just the user go/env. When I put GOTOOLCHAIN in go.env, but before I added it to the default printing list, 'go env GOTOOLCHAIN' was printing an empty string, and it was incredibly confusing. For #57001. Fixes #60361 while we're here. Also includes a fix for a review comment on CL 497079 that I forgot to mail. Change-Id: I7b904d9202f05af789aaa33aed93f903b515aa28 Reviewed-on: https://go-review.googlesource.com/c/go/+/497437 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> Run-TryBot: Russ Cox <rsc@golang.org>
Diffstat (limited to 'go.env')
-rw-r--r--go.env4
1 files changed, 4 insertions, 0 deletions
diff --git a/go.env b/go.env
index 826192283f..9bab8ffd73 100644
--- a/go.env
+++ b/go.env
@@ -6,3 +6,7 @@
# See https://proxy.golang.org for details.
GOPROXY=https://proxy.golang.org,direct
GOSUMDB=sum.golang.org
+
+# Automatically download newer toolchains as directed by go.mod files.
+# See https://go.dev/s/gotoolchain for details.
+GOTOOLCHAIN=auto