Skip to content

Instantly share code, notes, and snippets.

@xackery
Created May 16, 2020 05:49
Show Gist options
  • Save xackery/8d52139571deecf8e32fa73b4331a0e8 to your computer and use it in GitHub Desktop.
Save xackery/8d52139571deecf8e32fa73b4331a0e8 to your computer and use it in GitHub Desktop.
go compression
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