aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/internal/list/list.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2021-04-15 23:07:41 -0400
committerRuss Cox <rsc@golang.org>2021-04-16 19:21:48 +0000
commitdba89283ad05e600defc41dbf94df91ce9027566 (patch)
treefe30981bf9561d983b9f071d21a7b5821fb412a4 /src/cmd/go/internal/list/list.go
parent95ed5c3800a87ddf9b0ec3958eaaa1a969306293 (diff)
downloadgo-dba89283ad05e600defc41dbf94df91ce9027566.tar.gz
go-dba89283ad05e600defc41dbf94df91ce9027566.zip
cmd/go, go/build: add ToolTags to build.Default
The build.Default context really needs to accurately describe the default build context. The goexperiment tags being a special case in the go command violates that rule and is the root cause of the various try-bot failures blocking the enabling of regabi. (The cleanups I made in golang.org/x/tools were long overdue but are not strictly necessary for making regabi work; this CL is.) Having moved the GOEXPERIMENT parsing into internal/buildcfg, go/build can now use it to set up build.Default, in the new field ToolTags, meant to hold toolchain-determined tags (for now, just the experiments). And at the same time we can remove the duplication of GOOS and GOARCH defaults. And then once build.Default is set up accurately, the special case code in cmd/go itself can be removed, and the special case code in test/run.go is at least a bit less special. Change-Id: Ib7394e10aa018e492cb9a83fb8fb9a5011a8c25b Reviewed-on: https://go-review.googlesource.com/c/go/+/310732 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com> Reviewed-by: Austin Clements <austin@google.com>
Diffstat (limited to 'src/cmd/go/internal/list/list.go')
-rw-r--r--src/cmd/go/internal/list/list.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/cmd/go/internal/list/list.go b/src/cmd/go/internal/list/list.go
index 221370bd19..53bf75e27e 100644
--- a/src/cmd/go/internal/list/list.go
+++ b/src/cmd/go/internal/list/list.go
@@ -148,6 +148,7 @@ The template function "context" returns the build context, defined as:
UseAllFiles bool // use files regardless of +build lines, file names
Compiler string // compiler to assume when computing target paths
BuildTags []string // build constraints to match in +build lines
+ ToolTags []string // toolchain-specific build constraints
ReleaseTags []string // releases the current release is compatible with
InstallSuffix string // suffix to use in the name of the install dir
}