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.