Documentation
¶
Overview ¶
Package version provides semantic version parsing and manipulation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareVersions ¶ added in v1.1.0
CompareVersions compares two version strings and returns their relative ordering. It returns -1 if a < b, 0 if a == b, and 1 if a > b. If either version string cannot be parsed, an error is returned with context indicating which version failed to parse.
func IsGreaterE ¶ added in v1.1.0
IsGreaterE returns true if version a is greater than version b, along with any error that occurred during parsing. This is the preferred function for new code as it allows callers to distinguish between "version A is not greater" and "invalid version string".
If an error is returned, the boolean result should be ignored.
Types ¶
Click to show internal directories.
Click to hide internal directories.