Created
May 16, 2020 05:49
-
-
Save xackery/8d52139571deecf8e32fa73b4331a0e8 to your computer and use it in GitHub Desktop.
go compression
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
func main() { | |
fmt.Println("hello, world!") | |
} | |
/* | |
> GOOS=linux go build -o normal main.go | |
> ls -alh | grep normal | |
1.9M normal* | |
> GOOS=linux go build -o ldflags -ldflags="-s -w" main.go | |
> ls -alh | grep ldflags | |
1.4M ldflags* | |
> upx -9 -o upxcompressed ldflags | |
> ls -alh | grep upxcompressed | |
528K upxcompressed* | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment