Documentation
¶
Overview ¶
Package version implements the "version" command, which prints the application's build version and — when --verbose is set — VCS metadata (version control system, commit revision, and commit timestamp). Output format is selectable via --format: human-readable text (default) or JSON.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Options ¶
type Options struct {
// IO provides stdout/stderr writers for output.
IO *iostreams.IOStreams
// AppName is the application binary name, displayed in the version line.
AppName string
// Version is the application's build version string.
Version string
// OS is the operating system target (e.g., "linux", "darwin").
// Injected from runtime.GOOS so tests can control it.
OS string
// Arch is the architecture target (e.g., "amd64", "arm64").
// Injected from runtime.GOARCH so tests can control it.
Arch string
// BuildInfo holds VCS metadata (system name, commit, timestamp) embedded
// by the Go toolchain at build time.
BuildInfo cmdutil.BuildInfo
// Verbose controls whether VCS build metadata is displayed.
Verbose bool
// JSON selects machine-readable JSON output instead of the default human-readable text.
JSON bool
}
Options holds the dependencies and flag values for the version command.
Click to show internal directories.
Click to hide internal directories.