首页 > 代码库 > go build -ldflags

go build -ldflags

http://studygolang.com/articles/2052

ldflags 用法:【路径,非必需,除非你有目录层次】包名.变量

[path]packege.value

go build -ldflags "-X other.VERSION=1.0.0 -X gpxj/other.VERSION=1.0.3 -X main.VERSION=1.0.0 -X ‘main.BUILD_TIME=`date`‘ -X ‘main.GO_VERSION=`go version`‘" -v -o "server-${VERSION}-${COMMIT:0:7}" server.go

go build -ldflags