Documentation ¶
Overview ¶
package semver provides a type representing a semantic version, and facilities for parsing, serialisation and comparison.
See http://semver.org for more information on semantic versioning.
This package expands on the specification: a partial version string like "v2" or "v2.0" is considered valid, and expanded to "v2.0.0".
To parse a version string: s := "v1.0.7-alpha" v, err := semver.Parse(s) if err != nil { panic(err) } fmt.Println(v)
Visit godoc.org/github.com/ceralena/semver for the full package API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( EmptyVersion = errors.New("Empty version string") IllegalVersion = errors.New("Illegal version string") )
Functions ¶
This section is empty.
Types ¶
type Version ¶
A Version is a parsed semver version string.
If only a partial version was specified, the missing parts will be -1.
func Parse ¶
Parse takes the string representation of a version and returns a Version value if is valid.
The error value will either be nil, EmptyVersion or IllegalVersion.
func (Version) GreaterThan ¶
GreaterThan returns true if v is a higher version than o.