Enhance CPE generation for java GroupId and filtering (#402)

* enhance cpe generation for group id and filtering

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>

* rename group id const + add doc comment for HasAnyOfPrefixes

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
This commit is contained in:
Alex Goodman
2021-04-22 12:22:56 +00:00
committed by GitHub
parent 0c29090b42
commit d9de63c837
9 changed files with 333 additions and 44 deletions
+14
View File
@@ -0,0 +1,14 @@
package internal
import "strings"
// HasAnyOfPrefixes returns an indication if the given string has any of the given prefixes.
func HasAnyOfPrefixes(input string, prefixes ...string) bool {
for _, prefix := range prefixes {
if strings.HasPrefix(input, prefix) {
return true
}
}
return false
}