Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Version ¶
type Version struct {
// contains filtered or unexported fields
}
Version represents a semantic version; see https://semver.org/spec/v2.0.0.html.
func MustParse ¶
MustParse is like Parse but panics on any error. Recommended as an initializer for global values.
func Parse ¶
Parse creates a version from a string. The string must be a valid semantic version (as per https://semver.org/spec/v2.0.0.html) in the format:
"vMINOR.MAJOR.PATCH[-PRERELEASE][+METADATA]".
MINOR, MAJOR, and PATCH are numeric values (without any leading 0s). PRERELEASE and METADATA can contain ASCII characters and digits, hyphens and dots.
func (*Version) Compare ¶
Compare returns -1, 0, or +1 indicating the relative ordering of versions.
func (*Version) PreRelease ¶
PreRelease returns the pre-release version (if present).
Click to show internal directories.
Click to hide internal directories.