version

package
v0.0.0-...-d37c8fe Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package version carries the binary's build identity. Version is the static, human-facing Stage11 form; Commit and BuildDate are stamped at build time via -ldflags (see the Makefile). When those are unstamped — a `go install`, `go run`, `go test`, or a hand `go build` — BuildInfo falls back to the VCS metadata the Go toolchain embeds, so the binary can still report where it came from. This is what lets `doctor` tell a current binary from a stale one (the c11 load-pilot ran a days-old build silently because the binary carried no build identity at all).

Index

Constants

View Source
const Version = "0.01.002"

Version is the canonical human-facing Stage11 version (X.XX.XXX form). It is intentionally static — it does not move per build, which is exactly why a version string alone cannot distinguish a fresh binary from a stale one.

Variables

View Source
var (
	Commit    = ""
	BuildDate = ""
)

Commit and BuildDate are injected at build time via:

-ldflags "-X .../internal/version.Commit=<short-sha>[-dirty] -X .../internal/version.BuildDate=<rfc3339>"

They are empty in unstamped builds; BuildInfo fills the gap from the VCS stamp. A "-dirty" suffix on Commit marks a build off an uncommitted tree.

Functions

This section is empty.

Types

type Build

type Build struct {
	Version   string // static human-facing version
	Commit    string // short revision, "-dirty" suffix stripped into Dirty
	BuildDate string // RFC3339 UTC build/commit time, or "" if unknown
	Dirty     bool   // built from a modified (uncommitted) tree
	Known     bool   // a real commit AND date were resolved from some source
}

Build is the resolved build identity of this binary.

func BuildInfo

func BuildInfo() Build

BuildInfo resolves this binary's identity: ldflags-injected values win, with the Go VCS stamp as fallback for anything left empty.

Jump to

Keyboard shortcuts

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