Skip to content

Commit 8a5797a

Browse files
committed
cmd/go: revert multi-flag GOFLAGS doc example
This partially reverts https://golang.org/cl/135035. Reason for revert: multiple -ldflags=-foo flags simply override each other, since that's the logic for per-package flags. The suggested 'GOFLAGS=-ldflags=-s -ldflags=-w' has never worked for 'go build', and even breaks 'go test' and 'go vet'. There should be a way to specify -ldflags='-w -s' via GOFLAGS, which is being tracked in #29096. For now, just remove the incorrect suggestion. Fixes #29053. Change-Id: I9203056f7e5191e894bcd16595a92df2fb704ea7 Reviewed-on: https://go-review.googlesource.com/c/152479 Reviewed-by: Bryan C. Mills <[email protected]> Reviewed-by: Alan Donovan <[email protected]> Run-TryBot: Daniel Martí <[email protected]>
1 parent bcd3385 commit 8a5797a

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

src/cmd/go/alldocs.go

+1-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/cmd/go/internal/help/helpdoc.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -509,9 +509,7 @@ General-purpose environment variables:
509509
510510
Each entry in the GOFLAGS list must be a standalone flag.
511511
Because the entries are space-separated, flag values must
512-
not contain spaces. In some cases, you can provide multiple flag
513-
values instead: for example, to set '-ldflags=-s -w'
514-
you can use 'GOFLAGS=-ldflags=-s -ldflags=-w'.
512+
not contain spaces.
515513
516514
Environment variables for use with cgo:
517515

0 commit comments

Comments
 (0)