Go 1 · Quality and release builds

Set a version at build time

Set a string variable in package main from the command line.

go build -ldflags "-X main.version=1.2.3" -o myapp .

Official Go 1 documentation

More quality and release builds commands

All quality and release builds commands · Go 1 cheatsheet

Was this page helpful?