buildversion

package
v1.0.63 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 3, 2026 License: Apache-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
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

func Digest() [sha256.Size]byte

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.

func Format

func Format(version, commit, buildTime string) string

func Set

func Set(version, commit, buildTime string)

Set updates the binary stamp material. Empty inputs leave the prior value.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL