diff options
author | Austin Clements <austin@google.com> | 2021-03-17 12:22:58 -0400 |
---|---|---|
committer | Austin Clements <austin@google.com> | 2021-03-18 21:27:24 +0000 |
commit | 095ba225973152734b0722e7c5758accb2639c15 (patch) | |
tree | dbd56e2c50a1c2b4a6958b1a31574712ae350a44 /src/runtime/proc.go | |
parent | 0c93b16d015663a60ac77900ca0dcfab92310790 (diff) | |
download | go-095ba225973152734b0722e7c5758accb2639c15.tar.gz go-095ba225973152734b0722e7c5758accb2639c15.zip |
cmd/internal/objabi,runtime: simplify sys.GOEXPERIMENT parsing
Previously, the runtime had to understand the full syntax of the
GOEXPERIMENT environment variable. Now, sys.GOEXPERIMENT is the
pre-processed experiment list produced by objabi, so we can simplify
the runtime parser.
Change-Id: I0d113a4347dde50a35b8b1f2b0110c88fe802921
Reviewed-on: https://go-review.googlesource.com/c/go/+/303049
Trust: Austin Clements <austin@google.com>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src/runtime/proc.go')
-rw-r--r-- | src/runtime/proc.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/runtime/proc.go b/src/runtime/proc.go index 9ebfe70883..a666f86abc 100644 --- a/src/runtime/proc.go +++ b/src/runtime/proc.go @@ -6027,6 +6027,9 @@ func setMaxThreads(in int) (out int) { } func haveexperiment(name string) bool { + // GOEXPERIMENT is a comma-separated list of enabled + // experiments. It's not the raw environment variable, but a + // pre-processed list from cmd/internal/objabi. x := sys.GOEXPERIMENT for x != "" { xname := "" @@ -6039,9 +6042,6 @@ func haveexperiment(name string) bool { if xname == name { return true } - if len(xname) > 2 && xname[:2] == "no" && xname[2:] == name { - return false - } } return false } |