Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Compare ¶ added in v0.12.1
Compare compares two semantic versions in X.Y.Z form (a leading "v" is allowed and stripped via Normalize). It returns -1 if a < b, 0 if a == b, and 1 if a > b. A non-nil error is returned when either argument is not a valid semantic version.
func Normalize ¶
Normalize validates a semantic version and strips a leading "v". It returns the normalized version in "X.Y.Z" form.
func Parse ¶ added in v0.12.1
Parse converts a semantic version into its numeric major/minor/patch components. The input is normalized first (a leading "v" is stripped), so any value accepted by Normalize is accepted here. It returns an error when the version is invalid or a segment cannot be represented as an int.
Types ¶
This section is empty.