version

package
v1.2.120 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2024 License: MIT Imports: 6 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// GitTag
	// 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
	GitTag    = "v0.0.0-master+$Format:%h$" // git describe --long --tags --dirty --tags --always
	BuildTime = "1970-01-01T00:00:00Z"      // build date in ISO8601 format, output of $(date -u +'%Y-%m-%dT%H:%M:%SZ')
	GitHash   = "$Format:%H$"               // sha1 from git, output of $(git rev-parse HEAD)

	ServiceName        = filepath.Base(os.Args[0])
	ServiceDisplayName = filepath.Base(os.Args[0])
	ServiceDescription = ""
	ServiceId          = ""
)

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 Get added in v1.2.27

func Get() Version

Get returns GitTag as version

func (Version) BuildInfo

func (ver Version) BuildInfo() string

func (Version) Format

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

Format 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

Directories

Path Synopsis
Package verflag defines utility functions to handle command line flags related to version.
Package verflag defines utility functions to handle command line flags related to version.

Jump to

Keyboard shortcuts

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