aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/testdata/script/README
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2021-04-06 16:11:17 -0400
committerAustin Clements <austin@google.com>2021-04-08 02:17:20 +0000
commita8e55538af40905961c263d980760b76e9c43593 (patch)
tree5eab170e3d6a05b0806cda14891b13a611f290d5 /src/cmd/go/testdata/script/README
parent89ca1ce9a8fbb70800fe24cc13aa267c3c90aadb (diff)
downloadgo-a8e55538af40905961c263d980760b76e9c43593.tar.gz
go-a8e55538af40905961c263d980760b76e9c43593.zip
cmd/internal/objabi: make GOEXPERIMENT be a diff from default experiments
Right now the rules around handling default-on experiments are complicated and a bit inconsistent. Notably, objabi.GOEXPERIMENT is set to a comma-separated list of enabled experiments, but this may not be the string a user should set the GOEXPERIMENT environment variable to get that list of experiments: if an experiment is enabled by default but gets turned off by GOEXPERIMENT, then the string we report needs to include "no"+experiment to capture that default override. This complication also seeps into the version string we print for "go tool compile -V", etc. This logic is further complicated by the fact that it only wants to include an experiment string if the set of experiments varies from the default. This CL rethinks how we handle default-on experiments. Now that experiment state is all captured in a struct, we can simplify a lot of this logic. objabi.GOEXPERIMENT will be set based on the delta from the default set of experiments, which reflects what a user would actually need to pass on the command line. Likewise, we include this delta in the "-V" output, which simplifies this logic because if there's nothing to show in the version string, the delta will be empty. Change-Id: I7ed307329541fc2c9f90edd463fbaf8e0cc9e8ee Reviewed-on: https://go-review.googlesource.com/c/go/+/307819 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 'src/cmd/go/testdata/script/README')
-rw-r--r--src/cmd/go/testdata/script/README2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/go/testdata/script/README b/src/cmd/go/testdata/script/README
index d658cebfce..b4dcb1f5a2 100644
--- a/src/cmd/go/testdata/script/README
+++ b/src/cmd/go/testdata/script/README
@@ -29,7 +29,7 @@ Scripts also have access to these other environment variables:
GOARCH=<target GOARCH>
GOCACHE=<actual GOCACHE being used outside the test>
GOEXE=<executable file suffix: .exe on Windows, empty on other systems>
- GOEXPSTRING=<value of objabi.Expstring(), from GOEXPERIMENT when toolchain built>
+ GOEXPERIMENT=<value of objabi.GOEXPERIMENT>
GOOS=<target GOOS>
GOPATH=$WORK/gopath
GOPROXY=<local module proxy serving from cmd/go/testdata/mod>