Closed
Description
The previous documentation example mentioned GOFLAGS='-ldflags=-w -ldflags=-s'
, which does something completely different. The second per-package flag overrides the first, so the linker ends up being called with just -s
and not -w -s
.
There should be a way to do go build -ldflags='-w -s'
via GOFLAGS
. This can either be done by tweaking GOFLAGS
, or by tweaking per-package flags - I personally don't mind, as long as there's a way to achieve it.
Metadata
Metadata
Assignees
Type
Projects
Relationships
Development
No branches or pull requests
Activity
gopherbot commentedon Dec 4, 2018
Change https://golang.org/cl/152479 mentions this issue:
cmd/go: revert multi-flag GOFLAGS doc example
bcmills commentedon Dec 4, 2018
#26849 is one possible mechanism.
cmd/go: revert multi-flag GOFLAGS doc example
mvdan commentedon Dec 15, 2018
Go 1.11 supposedly shipped with this feature, so I'm milestoning this for 1.13 to "get that back". Within quotes because it never actually worked :)
bcmills commentedon Jan 17, 2019
The underlying use-case is the same as #26849. Consolidating into that issue.