add version.List

This commit is contained in:
Aneurin Barker Snook
2024-07-11 22:21:19 +01:00
parent 1eb61f45ea
commit e69de8b117
4 changed files with 73 additions and 5 deletions
+19
View File
@@ -0,0 +1,19 @@
package version
// List is a slice of versions that implements sort.Interface.
type List []*Version
func (list List) Len() int {
return len(list)
}
func (list List) Less(i, j int) bool {
return list[i].Less(list[j])
}
func (list List) Swap(i, j int) {
a := list[i]
b := list[j]
list[i] = b
list[j] = a
}