Documentation
¶
Overview ¶
Package buildinfo resolves build-time version information for the gonimbus binary. It is intentionally tiny and dependency-free so that the resolution logic remains predictable across build paths.
Resolution priority for the version string (highest first):
- Linker ldflags overrides — passed in via main as the `version` symbol. `make build` sets this from the VERSION file. Authoritative when set to anything other than the placeholder "dev".
- Embedded VERSION file — read at build time via `//go:embed VERSION`, kept in sync with the repo-root VERSION via `make sync-app-version`. This is the *repo's* statement of what version it is, which is what we want to report regardless of how the binary was produced. Notably: `go install ./cmd/...` from a working tree, `go build` from a clean checkout (which would otherwise return a Go pseudo-version derived from the latest tag), and any other build path without ldflags.
- runtime/debug.ReadBuildInfo Main.Version — only used as a final fallback if the embed is somehow empty. Generally not reached because the embed is bundled with the package.
- The literal "dev" — only if every source above is empty.
For commit and buildDate (which are NOT in the VERSION file), the order is ldflags → BuildInfo (vcs.revision, vcs.time) → "unknown". BuildInfo is the right fallback there because `go install module@vX.Y.Z` populates these settings from the module source even without ldflags.
See docs/architecture.md and gonimbus#6 for context.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.