version

package
v5.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: MIT Imports: 1 Imported by: 2 modules, 1 package

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

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

Jump to

Keyboard shortcuts

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