From cfc08ae7e3fde48a51764f5293cefbc193a53860 Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Thu, 20 Apr 2017 18:13:54 -0700 Subject: [PATCH] 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. --- plugin/discovery/version_set.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugin/discovery/version_set.go b/plugin/discovery/version_set.go index 951000b20..3dce045b4 100644 --- a/plugin/discovery/version_set.go +++ b/plugin/discovery/version_set.go @@ -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)