mirror of
https://github.com/edoardottt/cariddi.git
synced 2026-09-22 17:44:58 +02:00
update
This commit is contained in:
@@ -28,6 +28,7 @@ type Error struct {
|
||||
type ErrorMatched struct {
|
||||
Error Error
|
||||
Url string
|
||||
Match string
|
||||
}
|
||||
|
||||
//GetErrorRegexes returns all the error regexes
|
||||
@@ -48,3 +49,16 @@ func GetErrorRegexes() []Error {
|
||||
}
|
||||
return regexes
|
||||
}
|
||||
|
||||
//RemoveDuplicateErrors removes duplicates from secrets found
|
||||
func RemoveDuplicateErrors(input []ErrorMatched) []ErrorMatched {
|
||||
keys := make(map[string]bool)
|
||||
list := []ErrorMatched{}
|
||||
for _, entry := range input {
|
||||
if _, value := keys[entry.Match+entry.Url]; !value {
|
||||
keys[entry.Url] = true
|
||||
list = append(list, entry)
|
||||
}
|
||||
}
|
||||
return list
|
||||
}
|
||||
|
||||
+1
-1
@@ -333,7 +333,7 @@ func RemoveDuplicateSecrets(input []SecretMatched) []SecretMatched {
|
||||
keys := make(map[string]bool)
|
||||
list := []SecretMatched{}
|
||||
for _, entry := range input {
|
||||
if _, value := keys[entry.Url]; !value {
|
||||
if _, value := keys[entry.Match+entry.Url]; !value {
|
||||
keys[entry.Url] = true
|
||||
list = append(list, entry)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user