Update errors.go

This commit is contained in:
gilfoyle97
2022-02-11 20:00:52 +01:00
committed by GitHub
parent 786e61fcaa
commit fcb8d416c4
+7 -2
View File
@@ -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{}