aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/proc.go
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/runtime/proc.go
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/runtime/proc.go')
-rw-r--r--src/runtime/proc.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/runtime/proc.go b/src/runtime/proc.go
index 5f372bb063..8db3b767d1 100644
--- a/src/runtime/proc.go
+++ b/src/runtime/proc.go
@@ -6027,7 +6027,7 @@ func setMaxThreads(in int) (out int) {
}
func haveexperiment(name string) bool {
- x := sys.Goexperiment
+ x := sys.GOEXPERIMENT
for x != "" {
xname := ""
i := bytealg.IndexByteString(x, ',')