mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-09-06 09:06:44 +00:00
![Radek Simko](/assets/img/avatar_default.png)
* vendor: Ignore github.com/hashicorp/terraform/backend This is to avoid dependency sprawl - e.g. vendoring AWS or Azure SDK when we don't really need remote backend functionality in provider code - it's core's responsibility. * vendor: github.com/hashicorp/terraform/...@v0.10.0
29 lines
555 B
Go
29 lines
555 B
Go
package semver
|
|
|
|
import (
|
|
"sort"
|
|
)
|
|
|
|
// Versions represents multiple versions.
|
|
type Versions []Version
|
|
|
|
// Len returns length of version collection
|
|
func (s Versions) Len() int {
|
|
return len(s)
|
|
}
|
|
|
|
// Swap swaps two versions inside the collection by its indices
|
|
func (s Versions) Swap(i, j int) {
|
|
s[i], s[j] = s[j], s[i]
|
|
}
|
|
|
|
// Less checks if version at index i is less than version at index j
|
|
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))
|
|
}
|