Documentation
¶
Overview ¶
Package version reports which billet this is.
TWO SOURCES, IN ORDER, and neither is enough on its own.
GoReleaser stamps the tag into the vars below with -ldflags. Go 1.24+ also records the VCS tag in the binary by itself, which covers everyone who built with a plain `go build` or installed with `go install module@v0.1.0`. Relying only on the second would be one build flag away from silently reporting "(devel)" in a release artifact — GoReleaser passes -trimpath and its own flags, and -buildvcs=false or a build from a tarball with no .git produces exactly that.
It matters more than a version string usually does: billet sends this to GitHub as part of its client system info on every poll, so a deployment showing up in their telemetry is identifiable as billet rather than as nothing in particular.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Compare ¶ added in v0.6.0
Compare orders two release tags.
STRICT vX.Y.Z AND NOTHING ELSE, and the second answer is the one that matters. A development build reports "(devel)", a snapshot reports 0.0.0-SNAPSHOT-<sha> and an unstamped binary "(unknown)"; none of those is older or newer than a release, so ordering one would be a guess dressed as a verdict. ok is false whenever either side is not a release tag, and every caller that refuses or records on the strength of this answer does neither when it is false. That is what keeps a downgrade guard from refusing a developer's own build against a ledger it has every right to open.
The result is negative when a is older than b, zero when they name the same release and positive when a is newer.
func Dirty ¶
func Dirty() bool
Dirty reports whether the tree had uncommitted changes at build time.
func IsRelease ¶ added in v0.6.0
IsRelease reports whether a string is a release tag Compare can order.
Types ¶
This section is empty.