import "github.com/coreos/go-semver/semver"
Semantic Versions http://semver.org
Sort sorts the given slice of Version
func (p PreRelease) Slice() []string
Must is a helper for wrapping NewVersion and will panic if err is not nil.
BumpMajor increments the Major field by 1 and resets all other fields to their default values
BumpMinor increments the Minor field by 1 and resets all other fields to their default values
BumpPatch increments the Patch field by 1 and resets all other fields to their default values
Compare tests if v is less than, equal to, or greater than versionB, returning -1, 0, or +1 respectively.
Equal tests if v is equal to versionB.
LessThan tests if v is less than versionB.
Code:
vA := New("1.2.3") vB := New("3.2.1") fmt.Printf("%s < %s == %t\n", vA, vB, vA.LessThan(*vB))
Output:
1.2.3 < 3.2.1 == true
Set parses and updates v from the given version string. Implements flag.Value
Slice converts the comparable parts of the semver into a slice of integers.
Package semver imports 7 packages (graph) and is imported by 1857 packages. Updated 2019-07-06. Refresh now. Tools for package owners.