You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instead, we can use the -s and -w linker flags like this:
$ GOOS=linux go build cmd/go
$ ls -l go
-rwxr-xr-x 1 filippo staff 12493536 Apr 16 16:58 go
$ GOOS=linux go build -ldflags="-s -w" cmd/go
$ ls -l go
-rwxr-xr-x 1 filippo staff 8941952 Apr 16 17:08 go
Problem
Our binaries aren't stripped. This means unnecessary symbols and debug information is still in there. We should strip them to save space.
Solution
Run thestrip
command on them before packaging. It's just a small difference but we should still do it.Read the blog @unakatsuo posted below. :)
The text was updated successfully, but these errors were encountered: