version

package
v0.0.0-...-29ca9c5 Latest Latest
Warning

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

Go to latest
Published: May 19, 2017 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

The version package helps other packages to provide information about their current version and compare it to others. It follows the idea of semantic versioning.

Index

Constants

View Source
const (
	Metadata = "+"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Version

type Version interface {
	fmt.Stringer

	// Major returns the major version.
	Major() int

	// Minor returns the minor version.
	Minor() int

	// Patch return the path version.
	Patch() int

	// PreRelease returns a possible pre-release of the version.
	PreRelease() string

	// Metadata returns a possible build metadata of the version.
	Metadata() string

	// Less returns true if this version is less than the passed one.
	Less(cv Version) bool
}

Version defines the interface of a version.

func New

func New(major, minor, patch int, prmds ...string) Version

New returns a simple version instance. Parts of pre-release and metadata are passed as optional strings separated by version.Metadata ("+").

func PackageVersion

func PackageVersion() Version

PackageVersion returns the version of the version package.

Jump to

Keyboard shortcuts

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