result: add a Count() helper method

Signed-off-by: Alfredo Deza <adeza@anchore.com>
This commit is contained in:
Alfredo Deza 2020-08-06 10:20:29 -04:00
parent 4476fc9888
commit 44767fc2fb

View file

@ -53,3 +53,8 @@ func (r *Result) Enumerate() <-chan match.Match {
}()
return channel
}
// Count returns the total number of matches in a result
func (r *Result) Count() int {
return len(r.byPackage)
}