version

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildInfo

type BuildInfo struct {
	// TagVersion is the most recent tag name on the current branch.
	TagVersion string
	// PostTagCommits is the number of commits after BuildInfo.TagVersion's commit on the current branch.
	PostTagCommits uint
	// CommitHash is the full commit hash.
	CommitHash string
	// CommitId is the "short" version of BuildInfo.CommitHash.
	CommitId string
	// BuildUser is the user the program was compiled under.
	BuildUser string
	// If compiled under sudo, BuildInfo.RealBuildUser is the user that called sudo.
	RealBuildUser string
	// BuildTime is the time and date of the program's build time.
	BuildTime time.Time
	// BuildHost is the host the binary was compiled on.
	BuildHost string
	// Dirty specifies if the source was "dirty" (uncommitted/unstaged etc. files) at the time of compilation.
	Dirty bool
	// SourceControl is the source control version used. Only relevant if not a "clean" build or untagged.
	SourceControl string
	// Major is the major version, expressed as an uint per spec.
	Major uint
	// Minor is the minor version, expressed as an uint per spec.
	Minor uint
	// Patch is the patch version, expressed as an uint per spec.
	Patch uint
	// Pre
	Pre string
	// Build
	Build string
	// contains filtered or unexported fields
}

BuildInfo contains nativized version information.

var Ver *BuildInfo

Ver is populated by main() from the build script and used in other places.

func Version

func Version() (b *BuildInfo, err error)

Version returns the build information. See build.sh.

func (*BuildInfo) Detail

func (b *BuildInfo) Detail() (ver string)

Detail returns a multiline string containing every possible piece of information we collect.

func (*BuildInfo) Meta

func (b *BuildInfo) Meta() (meta string)

Meta returns the build/compile-time info.

func (*BuildInfo) Short

func (b *BuildInfo) Short() (ver string)

Short returns a uniquely identifiable version string.

Jump to

Keyboard shortcuts

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