plugin/discovery: provide an AllVersions set

Various implied dependencies will accept all versions, so this is
convenient for populating dependency data structures for such implied
dependencies.
pull/15208/head
Martin Atkins 9 years ago
parent e89b5390ca
commit cfc08ae7e3

@ -37,6 +37,15 @@ type VersionSet struct {
raw version.Constraints
}
// AllVersions is a VersionSet containing all versions
var AllVersions VersionSet
func init() {
AllVersions = VersionSet{
raw: make(version.Constraints, 0),
}
}
// Has returns true if the given version is in the receiving set.
func (s VersionSet) Has(v Version) bool {
return s.raw.Check(v.raw)

Loading…
Cancel
Save