From 8a5797a00e0bbe483e88aab4830e8854af55b508 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20Mart=C3=AD?= Date: Tue, 4 Dec 2018 16:25:39 +0000 Subject: [PATCH] cmd/go: revert multi-flag GOFLAGS doc example MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Alan Donovan Run-TryBot: Daniel Martí --- src/cmd/go/alldocs.go | 4 +--- src/cmd/go/internal/help/helpdoc.go | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/cmd/go/alldocs.go b/src/cmd/go/alldocs.go index 12134b21c0..9108775e75 100644 --- a/src/cmd/go/alldocs.go +++ b/src/cmd/go/alldocs.go @@ -1472,9 +1472,7 @@ // // Each entry in the GOFLAGS list must be a standalone flag. // Because the entries are space-separated, flag values must -// not contain spaces. In some cases, you can provide multiple flag -// values instead: for example, to set '-ldflags=-s -w' -// you can use 'GOFLAGS=-ldflags=-s -ldflags=-w'. +// not contain spaces. // // Environment variables for use with cgo: // diff --git a/src/cmd/go/internal/help/helpdoc.go b/src/cmd/go/internal/help/helpdoc.go index c8ea66a327..ba9b14a4e6 100644 --- a/src/cmd/go/internal/help/helpdoc.go +++ b/src/cmd/go/internal/help/helpdoc.go @@ -509,9 +509,7 @@ General-purpose environment variables: Each entry in the GOFLAGS list must be a standalone flag. Because the entries are space-separated, flag values must -not contain spaces. In some cases, you can provide multiple flag -values instead: for example, to set '-ldflags=-s -w' -you can use 'GOFLAGS=-ldflags=-s -ldflags=-w'. +not contain spaces. Environment variables for use with cgo: -- 2.50.0