version

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get() string

Types

type Provenance added in v1.0.0

type Provenance struct {
	Revision string
	Dirty    bool
	Time     string
}

Provenance is the VCS state the Go toolchain stamped into the binary. The zero value means no VCS metadata was embedded (go test, or a build outside a repository); only Dirty separates a working-tree build from the release version.txt claims.

func GetProvenance added in v1.0.0

func GetProvenance() Provenance

GetProvenance reads vcs.revision/vcs.modified/vcs.time from the running binary's build info.

func (Provenance) String added in v1.0.0

func (p Provenance) String() string

String renders "revision <rev> (working tree modified), built <time>", omitting absent parts; empty for the zero value.

Jump to

Keyboard shortcuts

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