Documentation
¶
Overview ¶
Package buildinfo carries the version string of the running binary.
The release path stamps Version at link time:
-X github.com/appshapes/brigade/internal/buildinfo.Version=0.1.0
`go install github.com/appshapes/brigade/cmd/brigade@v0.1.0` applies no ldflags, so Version is empty there and String falls back to the module version recorded by the toolchain in the binary's build info.
Index ¶
Constants ¶
const Unknown = "unknown"
Unknown is reported when neither the link-time stamp nor the embedded build info names a version — a plain `go build` with -buildvcs=false, or `go run`.
Variables ¶
var Version string
Version is set at link time by the -X flag above. It is deliberately a plain var and not a const: a const would be inlined and -X could not reach it.
Functions ¶
func Claimed ¶ added in v0.10.0
func Claimed() *string
Claimed is the version this binary reports about itself on the wire — the `brigade_version` member of a registration and a heartbeat (4.4.2, 4.4.4; C-46) — or nil when it has none to claim. A binary that was neither stamped nor installed from a module version (a plain `go build`, `go run`, a test binary) answers Unknown to a person who asks, but says NOTHING to a roster: an absent member reads as a blank cell, which is the honest rendering of "no version", where the word "unknown" in a VERSION column would be a claim of its own.
Types ¶
This section is empty.