Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Cmp ¶
Cmp takes two version structs and returns an integer value indicating the relationship between the two versions. 0: v1 == v2 1: v1 > v2 -1: v1 < v2
func CmpPart ¶
CmpPart takes two version components (e.g. Major, Minor, Patch, Suffix) and returns an integer value indicating the relationship between the two components. 0: v1 == v2 1: v1 > v2 -1: v1 < v2
func Upgrade ¶
Upgrade takes two version structs and returns three bools indicating the relationship between the two versions. 1. major: true if v2 is a major upgrade from V1 2. minor: true if v2 is a minor upgrade from V1 3. patch: true if v2 is a patch upgrade from V1 4. suffix: true if v2 is a suffix upgrade from V1
Types ¶
type Version ¶
type Version struct {
// Major version number (required)
Major string `json:"major"`
// Minor version number (required)
Minor string `json:"minor"`
// Patch level (optional)
Patch string `json:"patch,omitempty"`
// Suffix string, (optional)
Suffix string `json:"suffix,omitempty"`
}
Version holds the information to generate a semver string