version

package
v1.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 2, 2026 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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 Info

func Info() string

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL