Documentation
¶
Overview ¶
Package version holds the single source of truth for the example CLIs' version string. Every build self-identifies with the git commit it was built from, plus a "-dirty" suffix when the working tree had uncommitted changes:
- Builds that inject at link time (flake ldflags or release scripts) override everything via the injected variable.
- Plain go build / go install binaries read the VCS stamp the Go toolchain embeds (debug.BuildInfo vcs.revision and vcs.modified), yielding "10bd9ac" or "10bd9ac-dirty". The toolchain only stamps build/install binaries — go run and go test builds are unstamped and fall back to "dev".
- Builds from sources without VCS metadata (e.g. go install from a module proxy) also fall back to "dev".
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Version = resolve(injected, readBuildInfo())
Version is the CLI version: the ldflags-injected string when present, otherwise the git-derived VCS stamp, otherwise "dev".
Functions ¶
This section is empty.
Types ¶
This section is empty.