version¶
Print the build version, commit, and build date.
Flags¶
| Flag | Description |
|---|---|
-s, --simple |
Print only the version string (no commit/date) for scripting. |
Examples¶
# full output (version, commit, build date)
go-crap-tracker version
# bare version for scripts and CI
go-crap-tracker version --simple
Build-time injection¶
The values are set at build time via linker flags. make build derives them from git describe / git rev-parse and the current time:
ldflags = -X github.com/padiazg/go-crap-tracker/internal/version.version=$(shell git describe --tags --always --dirty)
ldflags += -X github.com/padiazg/go-crap-tracker/internal/version.commit=$(shell git rev-parse HEAD)
ldflags += -X github.com/padiazg/go-crap-tracker/internal/version.buildDate=$(shell date -Iseconds)