version

package
v1.1.10 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: MPL-2.0 Imports: 4 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrIsDevelopment = errors.New("this development binary has no semantic version")

ErrIsDevelopment is returned whenever functions are called that require a valid release version (generally, a valid semantic version) to parse.

Functions

func IsDevelopment

func IsDevelopment() bool

IsDevelopment returns true if the build type is not "release", and true otherwise. Note that checking whether the build type is "development" is not sufficient, because buildType may be empty when no ldflags are used.

func Semver

func Semver() (semver.Version, error)

Semver returns the build's parsed release version.

func ShortString

func ShortString() string

ShortString returns a machine-readable version string. If this is a release build, it returns the release version; otherwise, it returns the commit.

func String

func String() string

String returns a long, human-readable version string.

func Version added in v1.1.1

func Version() string

Version returns the version string as-is, even if empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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