mirror of
https://github.com/securego/gosec.git
synced 2024-12-27 04:55:53 +00:00
35 lines
588 B
Go
35 lines
588 B
Go
package match
|
|
|
|
type Matches []Match
|
|
|
|
func (s Matches) Len() int {
|
|
return len(s)
|
|
}
|
|
func (s Matches) Swap(i, j int) {
|
|
s[i], s[j] = s[j], s[i]
|
|
}
|
|
func (s Matches) Less(i, j int) bool {
|
|
if s[i].I < s[j].I {
|
|
return true
|
|
} else if s[i].I == s[j].I {
|
|
return s[i].J < s[j].J
|
|
} else {
|
|
return false
|
|
}
|
|
}
|
|
|
|
type Match struct {
|
|
Pattern string
|
|
I, J int
|
|
Token string
|
|
DictionaryName string
|
|
Entropy float64
|
|
}
|
|
|
|
type DateMatch struct {
|
|
Pattern string
|
|
I, J int
|
|
Token string
|
|
Separator string
|
|
Day, Month, Year int64
|
|
}
|