sort constraints for consistent output

pull/15208/head
James Bardin 9 years ago committed by Martin Atkins
parent 190d5fae76
commit ea3d9c86ba

@ -1,6 +1,8 @@
package discovery
import (
"sort"
version "github.com/hashicorp/go-version"
)
@ -61,6 +63,11 @@ func (s Constraints) Append(other Constraints) Constraints {
raw = append(raw, s.raw...)
raw = append(raw, other.raw...)
// while the set is unordered, we sort these lexically for consistent output
sort.Slice(raw, func(i, j int) bool {
return raw[i].String() < raw[j].String()
})
return Constraints{raw}
}

Loading…
Cancel
Save