Documentation
¶
Overview ¶
Package version carries the binary's build identity. Version is the static, human-facing Stage11 form; Commit and BuildDate are stamped at build time via -ldflags (see the Makefile). When those are unstamped — a `go install`, `go run`, `go test`, or a hand `go build` — BuildInfo falls back to the VCS metadata the Go toolchain embeds, so the binary can still report where it came from. This is what lets `doctor` tell a current binary from a stale one (the c11 load-pilot ran a days-old build silently because the binary carried no build identity at all).
Index ¶
Constants ¶
const Version = "0.01.002"
Version is the canonical human-facing Stage11 version (X.XX.XXX form). It is intentionally static — it does not move per build, which is exactly why a version string alone cannot distinguish a fresh binary from a stale one.
Variables ¶
var ( Commit = "" BuildDate = "" )
Commit and BuildDate are injected at build time via:
-ldflags "-X .../internal/version.Commit=<short-sha>[-dirty] -X .../internal/version.BuildDate=<rfc3339>"
They are empty in unstamped builds; BuildInfo fills the gap from the VCS stamp. A "-dirty" suffix on Commit marks a build off an uncommitted tree.
Functions ¶
This section is empty.
Types ¶
type Build ¶
type Build struct {
Version string // static human-facing version
Commit string // short revision, "-dirty" suffix stripped into Dirty
BuildDate string // RFC3339 UTC build/commit time, or "" if unknown
Dirty bool // built from a modified (uncommitted) tree
Known bool // a real commit AND date were resolved from some source
}
Build is the resolved build identity of this binary.