Documentation
¶
Overview ¶
Package buildinfo holds satelle's build identity — the version, commit, and build time stamped into the binary at release time via -ldflags.
It is deliberately dependency-free and decoupled from the CLI so the version surface can be wired through the verb registry later (build order step 4) without moving the stamped vars: the version verb will read the same Resolve() this package exposes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // Name defaults to the CLI product; the serve main stamps Name=satelle-serve. Name = "satelle" Version = "dev" Commit = "none" BuildTime = "unknown" )
Build info — overridden via -ldflags at release time. These are the single source of truth for satelle's build identity. Stamp with:
-ldflags "-X github.com/bobmcallan/satelle/internal/buildinfo.Version=0.0.1 ..." -ldflags "-X github.com/bobmcallan/satelle/internal/buildinfo.Name=satelle-serve ..."
Functions ¶
func IsReleaseVersion ¶
IsReleaseVersion reports whether v is a stamped release version — a real tag, not the unstamped "dev" sentinel or the VCS-derived dev string.
Types ¶
type Info ¶
type Info struct {
// Name is the artifact identity (e.g. "satelle", "satelle-serve") so
// footers and version lines brand the running binary, not a hard-coded
// product string.
Name string `json:"name"`
Version string `json:"version"`
Commit string `json:"commit"`
BuildTime string `json:"build_time"`
}
Info is the resolved build identity.
func Resolve ¶
func Resolve() Info
Resolve returns the effective build identity. A release binary is ldflag-stamped, so its values are returned verbatim. Any other build — a bare `go build`, an IDE run — leaves Version=="dev"; for those we fall back to the VCS stamp Go embeds via debug.ReadBuildInfo so `version` reports a real, git-derived string instead of the bare "dev".