Skip to content

Instantly share code, notes, and snippets.

@ziyoung
Created June 26, 2020 13:53
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 ziyoung/e67bf3e179b2cf52a41484176258dc9d to your computer and use it in GitHub Desktop.
Save ziyoung/e67bf3e179b2cf52a41484176258dc9d to your computer and use it in GitHub Desktop.
go build flag
# go build link
PKG_NAME = github.com/ziyoung/repo
GO_LDFLAGS = -X ${PKG_NAME}/pkg.Var=123
build:
go build -ldflags "${GO_LDFLAGS}" -o file ./some-file.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment