version

package
v1.2.8 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2022 License: MIT Imports: 4 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Version

type Version struct {
	Major      int
	Minor      int
	Patch      int
	PreRelease string

	// NOTE: The $Format strings are replaced during 'git archive' thanks to the
	// companion .gitattributes file containing 'export-subst' in this same
	// directory.  See also https://git-scm.com/docs/gitattributes
	// git describe --long --tags --dirty --tags --always
	// "v0.0.0-master+$Format:%h$"
	RawVersion string

	// build date in ISO8601 format, output of $(date -u +'%Y-%m-%dT%H:%M:%SZ')
	// "1970-01-01T00:00:00Z"
	BuildTime string
	// sha1 from git, output of $(git rev-parse HEAD)
	// "$Format:%H$"
	GitHash string

	MetaData []string // take effect when PreRelease contains devel
}

func (Version) BuildInfo

func (ver Version) BuildInfo() string

func (Version) Format

func (ver Version) Format(s fmt.State, verb rune)

Examples: v1.2.3-fix, Build #gc-go1.15.6-darwin/amd64, built on NOW

func (Version) String

func (ver Version) String() string

String formats the version string for this module in semver format.

Examples:

v1.20.1
v1.21.0-rc.1

Jump to

Keyboard shortcuts

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