Version: v1.29.2 Latest Latest

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

Go to latest
Published: Sep 9, 2021 License: MIT Imports: 4 Imported by: 0




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

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