semver

package
Version: v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2015 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Sort

func Sort(versions []*Version)

Sort sorts the given slice of Version

Types

type PreRelease

type PreRelease string

func (*PreRelease) Slice

func (p *PreRelease) Slice() []string

type Version

type Version struct {
	Major      int64
	Minor      int64
	Patch      int64
	PreRelease PreRelease
	Metadata   string
}

func Must added in v0.3.2

func Must(v *Version, err error) *Version

func NewVersion

func NewVersion(version string) (*Version, error)

func (*Version) BumpMajor

func (v *Version) BumpMajor()

BumpMajor increments the Major field by 1 and resets all other fields to their default values

func (*Version) BumpMinor

func (v *Version) BumpMinor()

BumpMinor increments the Minor field by 1 and resets all other fields to their default values

func (*Version) BumpPatch

func (v *Version) BumpPatch()

BumpPatch increments the Patch field by 1 and resets all other fields to their default values

func (*Version) LessThan

func (v *Version) LessThan(versionB Version) bool

func (*Version) Slice

func (v *Version) Slice() []int64

Slice converts the comparable parts of the semver into a slice of strings

func (*Version) String

func (v *Version) String() string

type Versions

type Versions []*Version

func (Versions) Len

func (s Versions) Len() int

func (Versions) Less

func (s Versions) Less(i, j int) bool

func (Versions) Swap

func (s Versions) Swap(i, j int)

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL