Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Diff ¶
Diff will calculate the difference between two semver versions. Since semver are not a well-defined numeric, the subtraction is limited to the difference between leftmost non-zero difference, i.e. if a difference is found in the major numbers, then that difference is returned and the others are represeneted as zeros. E.g. the difference between `2.0.0' and '1.6.99' is '1.0.0'
func Sort ¶
Sort versions in descending order
Sorting require, that we can reliably order the versions. If a mixed versioning scheme is used, e.g. a mix of semver and date-based versions (e.g. '2023-11-11'), then ordering versions without heuristics is impossible. To handle this we only accept semver v2.0.0 versions with the only exception being a leading 'v'.
Types ¶
This section is empty.