version

package
v2.1.155 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// VersionPrefix string for setting pre-release etc
	VersionPrefix = ""

	// ExampleVersion shows an example version in the help
	// if no version could be found (which should never really happen!)
	ExampleVersion = "1.1.59"

	// TestVersion used in test cases for the current version if no
	// version can be found - such as if the version property is not properly
	// included in the go test flags.
	TestVersion = "2.0.404"

	// TestRevision can be used in tests if no revision is passed in the test flags
	TestRevision = "04b628f48"

	// TestTreeState can be used in tests if no tree state is passed in the test flags
	TestTreeState = "clean"

	// TestBuildDate can be used in tests if no build date is passed in the test flags
	TestBuildDate = "2020-05-31T14:51:38Z"

	// TestGoVersion can be used in tests if no version is passed in the test flags
	TestGoVersion = "1.13.8"
)

Variables

View Source
var (
	Version      string
	Revision     string
	BuildDate    string
	GoVersion    string
	GitTreeState string
)

Build information. Populated at build-time.

View Source
var Map = map[string]string{
	"version":      Version,
	"revision":     Revision,
	"buildDate":    BuildDate,
	"goVersion":    GoVersion,
	"gitTreeState": GitTreeState,
}

Map provides the iterable version information.

Functions

func GetBuildDate added in v2.1.68

func GetBuildDate() string

GetBuildDate returns the build date for the binary

func GetGoVersion added in v2.1.68

func GetGoVersion() string

GetGoVersion returns the version of go used to build the binary

func GetRevision added in v2.1.68

func GetRevision() string

GetRevision returns the short SHA1 hashes given a given revision

func GetSemverVersion

func GetSemverVersion() (semver.Version, error)

GetSemverVersion returns a semver.Version struct representing the current version

func GetTreeState added in v2.1.68

func GetTreeState() string

GetTreeState returns the state of the working tree

func GetVersion

func GetVersion() string

GetVersion gets the current version string

func StringDefault added in v2.1.68

func StringDefault(defaultValue string) string

StringDefault returns the current version string or returns a dummy default value if there is an error

Types

This section is empty.

Jump to

Keyboard shortcuts

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