Documentation
¶
Overview ¶
Package buildversion owns the shared public version text, without build-state discovery, command construction or filesystem access.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ExecutableMaterial = cachedExecutableMaterial
ExecutableMaterial supplies bytes folded into Digest when the stamp is still the default unstamped triple (dev/unknown/unknown). Production uses a process-cached lightweight replace-detector over os.Executable() metadata (path + size + mtime); tests may swap this seam.
Behavior:
- Stamped builds (any non-default version/commit/buildTime): Digest is stamp-only so identical release binaries share one seal regardless of install path. Release ldflags stamp is the sole identity; no exe I/O.
- Unstamped local builds: Digest = hash(stamp || exe material) where exe material is a metadata fingerprint (path/size/mtime), NOT a full-file sha256. Short CLI invocations must not pay whole-binary I/O on every process when productionSchemaCacheOptions loads identity. Replacing a local go-build binary (A→B) still changes the seal via size/mtime/path without calling Invalidate*.
Residual risk: two different binaries that collide on path+size+mtime can share an unstamped seal; that edge case is accepted for startup cost.
Functions ¶
func CurrentStampForTest ¶
func CurrentStampForTest() (version, commit, buildTime string)
CurrentStampForTest returns the active stamp triple for test restore. Production must not call this; the ForTest suffix is the boundary.
func Digest ¶
Digest returns the binary-owned seal that persisted Schema cache identity sidecars must match. A sidecar alone cannot invent this value for a different binary. Release stamps use stamp-only material; unstamped builds also fold ExecutableMaterial so two different local binaries do not share a seal.
Types ¶
This section is empty.