Skip to content

Instantly share code, notes, and snippets.

@untoreh
Created January 5, 2018 06:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save untoreh/0ea2d820de0b5ee156f891068293f1a5 to your computer and use it in GitHub Desktop.
Save untoreh/0ea2d820de0b5ee156f891068293f1a5 to your computer and use it in GitHub Desktop.
build a stripped golang binary with statically linked c

build static go

-s -w for stripping

go build --ldflags '-s -w -linkmode external -extldflags "-static"' main.go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment