mirror of
https://github.com/edoardottt/cariddi.git
synced 2026-09-22 17:44:58 +02:00
Update errors.go
This commit is contained in:
+7
-2
@@ -19,19 +19,24 @@ along with this program. If not, see http://www.gnu.org/licenses/.
|
||||
package scanner
|
||||
|
||||
//Error struct
|
||||
// ErrorName = the name that identifies the error
|
||||
// Regex = The regular expression to be matched
|
||||
type Error struct {
|
||||
ErrorName string
|
||||
Regex []string
|
||||
}
|
||||
|
||||
//ErrorMatched struct
|
||||
// Error = Error struct
|
||||
// Url = url in which the error is found
|
||||
// Match = the string matching the regex
|
||||
type ErrorMatched struct {
|
||||
Error Error
|
||||
Url string
|
||||
Match string
|
||||
}
|
||||
|
||||
//GetErrorRegexes returns all the error regexes
|
||||
//GetErrorRegexes returns all the error structs
|
||||
func GetErrorRegexes() []Error {
|
||||
var regexes = []Error{
|
||||
{
|
||||
@@ -60,7 +65,7 @@ func GetErrorRegexes() []Error {
|
||||
return regexes
|
||||
}
|
||||
|
||||
//RemoveDuplicateErrors removes duplicates from secrets found
|
||||
//RemoveDuplicateErrors removes duplicates from Errors found
|
||||
func RemoveDuplicateErrors(input []ErrorMatched) []ErrorMatched {
|
||||
keys := make(map[string]bool)
|
||||
list := []ErrorMatched{}
|
||||
|
||||
Reference in New Issue
Block a user