-
Notifications
You must be signed in to change notification settings - Fork 17.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/go: the example 'GOFLAGS=-ldflags=-s -ldflags=-w' does not work #29053
Comments
This is actually worse than I thought - it seems like repeated flags don't even work with
Seems like only the last |
The same happens with |
It looks like that's how
That is, That begs the question; how can one use For now, I'll send a CL to at least stop /cc @rsc |
Change https://golang.org/cl/151980 mentions this issue: |
Change https://golang.org/cl/152479 mentions this issue: |
In https://golang.org/cmd/go/, one can read:
I don't use a debugger, so skipping DWARF and symbol tables speeds up linking binaries and saves space on disk. So I've set up
export GOFLAGS="-ldflags=-s -ldflags=-w"
in my.bash_profile
, like the doc page says. And that works fine forgo build
andgo install
, for example.However:
This might be because
go vet
does its own flag parsing. The fact thatgo test
shows the same bug seems to point in that direction.Seems like a bug to fix in 1.12, since the
cmd/go
doc page suggests doing something that completely breaksgo test
andgo vet
. It's also broken on 1.11.2. I'll have a quick look this afternoon./cc @bcmills @alandonovan
The text was updated successfully, but these errors were encountered: