mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 16:33:21 +01:00
* 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>
15 lines
306 B
Go
15 lines
306 B
Go
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
|
|
}
|