aboutsummaryrefslogtreecommitdiff
path: root/src/internal
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2020-12-23 19:49:39 -0800
committerMatthew Dempsky <mdempsky@google.com>2021-03-11 21:43:04 +0000
commit7fc638d6f1679f2e35862555531bf479c3e5b99c (patch)
tree70360705cea1ab8adf672605f5ba2f4724b9b6de /src/internal
parentb3896fc331c36a539f825f1f656cef3f9cdffd3f (diff)
downloadgo-7fc638d6f1679f2e35862555531bf479c3e5b99c.tar.gz
go-7fc638d6f1679f2e35862555531bf479c3e5b99c.zip
cmd: move GOEXPERIMENT knob from make.bash to cmd/go
This CL changes GOEXPERIMENT to act like other GO[CONFIG] environment variables. Namely, that it can be set at make.bash time to provide a default value used by the toolchain, but then can be manually set when running either cmd/go or the individual tools (compiler, assembler, linker). For example, it's now possible to test rsc.io/tmp/fieldtrack by simply running: GOEXPERIMENT=fieldtrack go test -gcflags=-l rsc.io/tmp/fieldtrack \ -ldflags=-k=rsc.io/tmp/fieldtrack.tracked without needing to re-run make.bash. (-gcflags=-l is needed because the compiler's inlining abilities have improved, so calling a function with a for loop is no longer sufficient to suppress inlining.) Fixes #42681. Change-Id: I2cf8995d5d0d05f6785a2ee1d3b54b2cfb3331ca Reviewed-on: https://go-review.googlesource.com/c/go/+/300991 Trust: Matthew Dempsky <mdempsky@google.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
Diffstat (limited to 'src/internal')
-rw-r--r--src/internal/cfg/cfg.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/internal/cfg/cfg.go b/src/internal/cfg/cfg.go
index 553021374d..815994b679 100644
--- a/src/internal/cfg/cfg.go
+++ b/src/internal/cfg/cfg.go
@@ -39,6 +39,7 @@ const KnownEnv = `
GOCACHE
GOENV
GOEXE
+ GOEXPERIMENT
GOFLAGS
GOGCCFLAGS
GOHOSTARCH