7 // Versions represents multiple versions.
8 type Versions []Version
10 // Len returns length of version collection
11 func (s Versions) Len() int {
15 // Swap swaps two versions inside the collection by its indices
16 func (s Versions) Swap(i, j int) {
17 s[i], s[j] = s[j], s[i]
20 // Less checks if version at index i is less than version at index j
21 func (s Versions) Less(i, j int) bool {
25 // Sort sorts a slice of versions
26 func Sort(versions []Version) {
27 sort.Sort(Versions(versions))