Documentation
¶
Overview ¶
Package buildinfo reports build-time metadata. Release builds inject exact values via -ldflags (GoReleaser); local/dev builds (the dev wrapper, `go build`) have none, so we recover what we can from the embedded VCS stamp (commit + dirty flag) and the binary's own mtime as the build time. Because the dev wrapper rebuilds on every launch, that mtime makes each dev build uniquely identifiable — so a boot banner can tell you exactly which build is running.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( Version = "dev" Commit = "none" Date = "unknown" )
These are overridden at release time, e.g.:
-X github.com/memcode-ai/memcode/internal/buildinfo.Version=1.2.3
var DevBuild = ""
DevBuild is stamped "1" by the dev wrapper's ldflags. Default is OFF, so a release build (or any build that forgets the flag) can never accidentally show dev diagnostics.
Functions ¶
func Compact ¶
func Compact() string
Compact is the build identifier for the always-on footer — always a REAL version. A clean release shows just its semver (e.g. "1.2.3"); a dev build shows the synthesized baseVersion-dev+commit (e.g. "0.1.0-dev+a1b2c3d-dirty"), where the commit is the per-build identifier. No build timestamps — the footer carries a version, not a clock.
func IsDev ¶
func IsDev() bool
IsDev reports whether this is a local/dev build: the dev wrapper stamps DevBuild=1 (it also stamps a real semver, so Version alone can't tell), and a bare `go build` has no ldflags at all (Version stays "dev").
Types ¶
This section is empty.