diff options
author | Austin Clements <austin@google.com> | 2021-03-18 11:35:45 -0400 |
---|---|---|
committer | Austin Clements <austin@google.com> | 2021-03-18 21:27:21 +0000 |
commit | d3ab6b50496a58ff3deb2502b6c8b9b38947eeca (patch) | |
tree | 828edd59e36f6c89b5c3335c0ff734093fe88084 /test/run.go | |
parent | bdbba224040a0f079a80368d9956f85a10577045 (diff) | |
download | go-d3ab6b50496a58ff3deb2502b6c8b9b38947eeca.tar.gz go-d3ab6b50496a58ff3deb2502b6c8b9b38947eeca.zip |
test: switch fieldtrack test to use GOEXPERIMENT
Now that we can set GOEXPERIMENT at build time, we no longer need
-d=fieldtrack in the compiler to enabled field tracking at build time.
Switch the one test that uses -d=fieldtrack to use GOEXPERIMENT
instead so we can eliminate this debug flag and centralize on
GOEXPERIMENT.
Updates #42681.
Change-Id: I14c352c9a97187b9c5ec8027ff672d685f22f543
Reviewed-on: https://go-review.googlesource.com/c/go/+/302969
Trust: Austin Clements <austin@google.com>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'test/run.go')
-rw-r--r-- | test/run.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/test/run.go b/test/run.go index 4c01886560..7d5a558f2d 100644 --- a/test/run.go +++ b/test/run.go @@ -513,7 +513,7 @@ func (t *test) run() { return } - var args, flags []string + var args, flags, runenv []string var tim int wantError := false wantAuto := false @@ -572,6 +572,9 @@ func (t *test) run() { if err != nil { t.err = fmt.Errorf("need number of seconds for -t timeout, got %s instead", args[0]) } + case "-goexperiment": // set GOEXPERIMENT environment + args = args[1:] + runenv = append(runenv, "GOEXPERIMENT="+args[0]) default: flags = append(flags, args[0]) @@ -628,6 +631,7 @@ func (t *test) run() { if tempDirIsGOPATH { cmd.Env = append(cmd.Env, "GOPATH="+t.tempDir) } + cmd.Env = append(cmd.Env, runenv...) var err error |