mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-26 19:30:55 +01:00
25 lines
373 B
Go
25 lines
373 B
Go
package config
|
|
|
|
import (
|
|
"github.com/zricethezav/gitleaks/v8/regexp"
|
|
)
|
|
|
|
func anyRegexMatch(f string, res []*regexp.Regexp) bool {
|
|
for _, re := range res {
|
|
if regexMatched(f, re) {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
|
|
func regexMatched(f string, re *regexp.Regexp) bool {
|
|
if re == nil {
|
|
return false
|
|
}
|
|
if re.FindString(f) != "" {
|
|
return true
|
|
}
|
|
return false
|
|
}
|