1package 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} 18