Documentation
¶
Overview ¶
Package buildinfo exposes the build-time version string used by both the PeeringDB User-Agent and the OTel resource so they stay in lockstep.
Resolution order:
- injected — set via ldflags `-X github.com/dotwaffle/peeringdb-plus/internal/buildinfo.injected=<value>` at Docker build time (computed from `git describe --tags --always`). This is the production path: tagged releases emit `v1.17`, post-tag dev builds emit `v1.17-3-gabc1234`.
- Main.Version from runtime/debug.ReadBuildInfo — populated for `go install` of a tagged module path (the module-proxy path).
- vcs.revision (first 7 chars) from build settings — `go build` from a local checkout with `.git` present.
- Literal "unknown" — last resort.
Without injection (e.g. under `go test`), the test-mode binaries fall through to (3) or (4); the peeringdb User-Agent test asserts the surrounding shape, not the version literal, so test runs stay stable.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SourceTime ¶ added in v1.25.0
SourceTime returns the UTC source timestamp recorded by the Go toolchain. It returns the zero time when build information or vcs.time is unavailable or malformed.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.