Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( Version = "dev" Commit = "none" Date = "unknown" )
Version, Commit, and Date are set at link time by goreleaser/`make build` via -ldflags. When the binary is built without that injection — most importantly `go install github.com/CommitBrief/commitbrief/cmd/commitbrief@vX.Y.Z` — Resolve() backfills them from the Go module BuildInfo (see Resolve doc).
Functions ¶
func Resolve ¶ added in v0.6.0
func Resolve()
Resolve fills Version/Commit/Date from runtime/debug.BuildInfo when they still hold their compile-time defaults. ldflags-injected values always win, so production binaries (brew, scoop, GitHub Releases tarballs) are unaffected. `go install …@vX.Y.Z` benefits: Main.Version becomes "vX.Y.Z" and the VCS settings carry the upstream commit and build timestamp, so --version stops reporting "dev (commit none, built unknown)".
Not auto-called via init(): existing tests assert the bare defaults, and main() is the single right place to opt in.
Types ¶
This section is empty.