versionutil

package
v0.0.0-...-955c50f Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 5 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compare

func Compare(this string, other string, strictSort bool) int

Compare returns 0 if two versions are equal a negative number if this < other and a positive number if this > other If this and other are both compliant with semver, then semver sorting rules are used Otherwise the versions are compared component-by-component, numerically if both are numeric If !strictSort insignificant trailing components are ignored (1.0.0.0 == 1) and the alpha comparison is case-insensitive

func IsValidVersion

func IsValidVersion(version string) bool

func VersionCompare

func VersionCompare(versionl string, versionr string) (result int, err error)

VersionCompare compares two version strings

Types

type ByVersion

type ByVersion []string

ByVersion implements sorting versions (by component) using semver if applicable

func (ByVersion) Len

func (s ByVersion) Len() int

func (ByVersion) Less

func (s ByVersion) Less(i, j int) bool

func (ByVersion) Swap

func (s ByVersion) Swap(i, j int)

Jump to

Keyboard shortcuts

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