versioncompare

package
v0.18.1 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LessThan     = -1
	EqualTo      = 0
	GreatherThan = 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type TolerantVersion

type TolerantVersion struct {
	// contains filtered or unexported fields
}

TolerantVersion is a flexible version representation

func New

func New(versionString string) *TolerantVersion

New returns new TolerantVersion

func NewMax

func NewMax() *TolerantVersion

NewMax returns a special version which is always greater than any other version

func NewMin

func NewMin() *TolerantVersion

NewMin returns a special version which is always less than any other version

func (*TolerantVersion) Compare

func (v *TolerantVersion) Compare(other *TolerantVersion) int

Compare compares this version and the argument version and returns 1 if the argument's version is higher, -1 if argument's version is lower and 0 if they are equal (three-way comparison)

func (*TolerantVersion) CompareWithConditional

func (v *TolerantVersion) CompareWithConditional(condition string, b *TolerantVersion) (valid bool, err error)

CompareWithConditional evaluates a conditional statement

func (*TolerantVersion) String

func (v *TolerantVersion) String() string

String returns the original string representation of the version

Jump to

Keyboard shortcuts

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