Back to godoc.org

Package semver

v1.25.0
Latest Go to latest

The latest major version is .

Published: Sep 10, 2020 | License: MIT | Module: go.uber.org/thriftrw

Index

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

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier