mirror of
https://github.com/anchore/syft.git
synced 2026-10-30 14:02:26 +01:00
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:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user