provenance

package
v2.0.0-rc13 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultVersion should match the value debug.BuildInfo uses for an unset
	// main module version.
	DefaultVersion   = "(devel)"
	DefaultGitCommit = "gcUnknown"
	DefaultBuildDate = "bdUnknown"
)

Variables

This section is empty.

Functions

func GetMostRecentTag

func GetMostRecentTag(m debug.Module) (string, error)

Types

type Provenance

type Provenance struct {
	// Version of the binary, assumed to be in semver format.
	Version string `json:"version,omitempty" yaml:"version,omitempty"`
	// GitCommit is a git commit
	GitCommit string `json:"gitCommit,omitempty" yaml:"gitCommit,omitempty"`
	// BuildDate is date of the build.
	BuildDate string `json:"buildDate,omitempty" yaml:"buildDate,omitempty"`
	// GoOs holds OS name.
	GoOs string `json:"goOs,omitempty" yaml:"goOs,omitempty"`
	// GoArch holds architecture name.
	GoArch string `json:"goArch,omitempty" yaml:"goArch,omitempty"`
	// GoVersion holds Go version.
	GoVersion string `json:"goVersion,omitempty" yaml:"goVersion,omitempty"`
}

Provenance holds information about the build of an executable.

func GetProvenance

func GetProvenance() Provenance

GetProvenance returns an instance of Provenance.

func (Provenance) Short

func (v Provenance) Short() string

Short returns the shortened provenance stamp.

Jump to

Keyboard shortcuts

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