semver

package
v1.25.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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

Jump to

Keyboard shortcuts

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