blob: cc888d43e6b614eb06647f3b93c3463a9fba8cd7 [file] [log] [blame]
Scott Baker1fe72732019-10-21 10:58:51 -07001package version
2
3// Collection is a type that implements the sort.Interface interface
4// so that versions can be sorted.
5type Collection []*Version
6
7func (v Collection) Len() int {
8 return len(v)
9}
10
11func (v Collection) Less(i, j int) bool {
12 return v[i].LessThan(v[j])
13}
14
15func (v Collection) Swap(i, j int) {
16 v[i], v[j] = v[j], v[i]
17}