4 ms·
Don't forget to pass -ldflags "-s -w" to `go build`. Debugging symbols are over 50% of most Go binaries I see, and you don't even need them to get stack traces
by brobinson 9y ago
Don't forget to pass -ldflags "-s -w" to `go build`.
Debugging symbols are over 50% of most Go binaries I see, and you don't even need them to get stack traces from panics.
Combined with `upx --ultra-brute`, you can get static Go binaries down to about 12-15% of their plain `go build` size in my experience. (This also assumes CGO_ENABLED=0)