This commit is contained in:
edoardottt
2021-11-28 12:46:21 +01:00
parent f9c83a331b
commit a3ffa5b005
+13
View File
@@ -327,3 +327,16 @@ func GetSecretRegexes() []Secret {
}
return regexes
}
//RemoveDuplicateSecrets removes duplicates from secrets found
func RemoveDuplicateSecrets(input []SecretMatched) []SecretMatched {
keys := make(map[string]bool)
list := []SecretMatched{}
for _, entry := range input {
if _, value := keys[entry.Url]; !value {
keys[entry.Url] = true
list = append(list, entry)
}
}
return list
}