Open NobbZ opened 4 years ago
I noticed this too.
We can probably use something like:
go build -ldflags '-s -w'
Note that we'd still get good stack traces from panics.
I believe this is the preferred way to strip Go binaries (rather than using strip
), and that it's considered safe nowadays. But in the (somewhat distant) past there were problems with stripping them, especially on more obscure platforms. See e.g. here.
But it's still a Go binary - it's never going to be small.
The linux binary has a size of 11MiB, after applying
strip
it is down to 7.1 MiB.This is a reduction by roughly 33%.
Considering that also 8MiB is the magic barrier for binary size in some online/cloud IDE services stripping really could be worth it.