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: 3 modules, 6 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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