semver

package
v0.20.4 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2024 License: Apache-2.0 Imports: 4 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Version

type Version struct {
	Major, Minor, Patch       int64
	Prerelease, Buildmetadata string
}

func New

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

func (*Version) Compare added in v0.6.1

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

func (*Version) CompareBuildMetadata added in v0.19.0

func (v *Version) CompareBuildMetadata(v2 *Version) int

CompareBuildMetadata compares the build metadata of v and v2. The metadata is split in its identifiers and these compared one by one. Number identifiers are considered lower than strings. If one build metadata is a prefix of the other, the longer one is considered greater. -1 == v is less than v2. 0 == v is equal to v2. 1 == v is greater than v2. 2 == v is different than v2 (it is not possible to identify if lower or greater).

func (*Version) Equal

func (v *Version) Equal(v2 *Version) bool

func (*Version) GreaterThan added in v0.6.1

func (v *Version) GreaterThan(v2 *Version) bool

func (*Version) LessThan added in v0.6.1

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

func (*Version) SameMajor

func (v *Version) SameMajor(v2 *Version) bool

func (*Version) SameMinor

func (v *Version) SameMinor(v2 *Version) bool

func (*Version) SamePatch

func (v *Version) SamePatch(v2 *Version) bool

func (*Version) SamePrerelease

func (v *Version) SamePrerelease(v2 *Version) bool

func (*Version) String added in v0.6.1

func (v *Version) String() string

Jump to

Keyboard shortcuts

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