This section is empty.


This section is empty.


This section is empty.


type Range

type Range struct {
	Begin Version
	End   Version

Range is the range of version numbers that lie in [Begin, End).

func CompatibleRange

func CompatibleRange(v Version) (r Range)

CompatibleRange generates the compatibility range for generated code and plugins.

Assuming current Version is 1.2.3-pre we get:

begin >= 1.0.0

end  < 1.3.0-pre

func (*Range) Contains

func (r *Range) Contains(other Version) bool

Contains returns true if the given semver version number is in this range.

type Version

type Version struct {
	Major uint
	Minor uint
	Patch uint
	Pre   []string
	Meta  string

Version is a parsed semantic version representation.

func Parse

func Parse(v string) (r Version, err error)

Parse a semantic version string.

func (*Version) Compare

func (v *Version) Compare(b *Version) int

Compare returns:

0 if a == b

-1 if a < b +1 if a > b

func (*Version) String

func (v *Version) String() string