Documentation
¶
Overview ¶
Package meta holds build-time metadata for the anfra binary.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Version = ""
Version is the anfra version this binary is.
A release injects it at build time, as the `version` from manifest.yml (the single source of truth, which also names the `v<version>` tag):
go build -ldflags "-X github.com/holistics/anfra/internal/meta.Version=0.4.3"
Built into another program, which imports anfra as a module (anfra-cloud's server, say), it is the version of anfra that program pins, as Go records it in the binary: a release, 0.4.3, or an unreleased commit's pseudo-version, 0.4.4-0.20260722101500-f4fb35812ab3. Nothing is injected there: the program's build sets its own version, not anfra's.
Any other build is one from source, and says which: the release it comes after (base), then, as semver build metadata, the commit it was built from and whether the tree had uncommitted changes, as Go records them in the binary: 0.4.3+f4fb358, or 0.4.3+f4fb358.dirty. Build metadata leaves the order alone, so such a build sorts with the release it comes after; and a release never carries any, so its presence alone tells a build from source (FromSource).
Functions ¶
func FromSource ¶
func FromSource() bool
FromSource reports whether this binary was built from source rather than released: its version carries build metadata.
Types ¶
This section is empty.