semver

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compare

func Compare(v1, v2 *Version) int

Compare compares two version comp := compareSemVer(v1, v2)

if comp < 0 {
	fmt.Println("v1 < v2")
} else if comp > 0 {
	fmt.Println("v1 > v2")
} else {
	fmt.Println("v1 == v2")
}

Types

type Version

type Version struct {
	Major      int
	Minor      int
	Patch      int
	Prerelease string
	Metadata   string
}

func Parse

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

Jump to

Keyboard shortcuts

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