pip compatible server to serve Python packages out of GitHub
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
package semver
|
|
|
|
|
|
import (
|
|
|
"sort"
|
|
|
)
|
|
|
|
|
|
type Versions []Version
|
|
|
|
|
|
func (s Versions) Len() int {
|
|
|
return len(s)
|
|
|
}
|
|
|
|
|
|
func (s Versions) Swap(i, j int) {
|
|
|
s[i], s[j] = s[j], s[i]
|
|
|
}
|
|
|
|
|
|
func (s Versions) Less(i, j int) bool {
|
|
|
return s[i].LT(s[j])
|
|
|
}
|
|
|
|
|
|
// Sort sorts a slice of versions
|
|
|
func Sort(versions []Version) {
|
|
|
sort.Sort(Versions(versions))
|
|
|
}
|