diff options
| author | Russ Cox <rsc@golang.org> | 2021-10-25 16:02:07 -0400 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2021-11-30 18:09:02 +0000 |
| commit | 931d80ec17374e52dbc5f9f63120f8deb80b355d (patch) | |
| tree | 0c3d2a40623b8d7b75d8b5e0508a5541112140e9 /src/debug | |
| parent | 682435dd9991040073ae12021fac164b41376502 (diff) | |
| download | go-931d80ec17374e52dbc5f9f63120f8deb80b355d.tar.xz | |
cmd/go: adjust BuildInfo.Settings
Make Settings more closely align with command-line flags
and environment variables.
- Change command-line flags to begin with -
- Change syntax of build lines to use Key=Value instead of Key<tab>Value.
- Change CGO_ENABLED to 0/1, matching environment variable,
instead of false/true.
- Add GOOS and GOARCH.
These are technically redundant, in that they can be extracted
from the binary in other ways most of the time, but not always:
GOOS=ios and GOOS=darwin may produce binaries that are
difficult to tell apart. In any case, it's a lot easier to have them
directly in the settings list than derive them from other parts
of the binary.
- Add GOEXPERIMENT.
These could be inferred from the tags list, but the experiments
are being removed from the tags list.
- Change the tags list to match the -tags command-line argument.
- Add msan and race, echoing the -msan and -race arguments
(always 'true' when present, omitted when false).
- Add GO$GOARCH when set.
Change-Id: Icb59ef4faa5c22407eadd94147b7e53cf4344ce6
Reviewed-on: https://go-review.googlesource.com/c/go/+/358539
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Diffstat (limited to 'src/debug')
| -rw-r--r-- | src/debug/buildinfo/buildinfo_test.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/debug/buildinfo/buildinfo_test.go b/src/debug/buildinfo/buildinfo_test.go index 44d78a6be0..fd31caf135 100644 --- a/src/debug/buildinfo/buildinfo_test.go +++ b/src/debug/buildinfo/buildinfo_test.go @@ -124,7 +124,7 @@ func TestReadFile(t *testing.T) { // build lines are included. got = goVersionRe.ReplaceAllString(got, "go\tGOVERSION\n") got = buildRe.ReplaceAllStringFunc(got, func(match string) string { - if strings.HasPrefix(match, "build\tcompiler\t") { + if strings.HasPrefix(match, "build\t-compiler=") { return match } return "" @@ -163,7 +163,7 @@ func TestReadFile(t *testing.T) { want: "go\tGOVERSION\n" + "path\texample.com/m\n" + "mod\texample.com/m\t(devel)\t\n" + - "build\tcompiler\tgc\n", + "build\t-compiler=gc\n", }, { name: "invalid_modules", |
