version

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package version exposes build-time version metadata.

The values are populated via -ldflags -X at build time. See the project Makefile and .goreleaser.yml for the canonical ldflag set.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Version is the semantic version (e.g. "1.2.3"). "dev" for unreleased builds.
	Version = "dev"

	// GitCommit is the full git SHA of the build, or "unknown".
	GitCommit = "unknown"

	// BuildDate is an RFC3339 timestamp, or "unknown".
	BuildDate = "unknown"
)

Functions

func String

func String() string

String returns a short version string suitable for cobra's Version field. Cobra will prefix it with the binary name itself, so we do not include it here.

Types

type BuildInfo

type BuildInfo struct {
	Version   string
	GitCommit string
	BuildDate string
}

BuildInfo is the structured form of the build metadata, suitable for programmatic access by importers of pkg/version.

func Info

func Info() BuildInfo

Info returns a copy of the current build info.

Jump to

Keyboard shortcuts

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