corrects incorrectly scoped continue
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"regexp"
|
||||
"sort"
|
||||
|
||||
@ -28,21 +29,30 @@ func cleanBadDomains(domains []string) []string {
|
||||
// remove duplicates
|
||||
domains = removeDuplicateStr(domains)
|
||||
|
||||
fmt.Printf("Processing: \n")
|
||||
|
||||
for _, domain := range domains {
|
||||
// removing trailing dots
|
||||
domain = regexp.MustCompile(`\.$`).ReplaceAllString(domain, "")
|
||||
|
||||
// skip domains that are too long
|
||||
if len([]rune(domain)) > 230 {
|
||||
fmt.Printf("-")
|
||||
continue
|
||||
}
|
||||
|
||||
// skip domains that are allowed
|
||||
var skip bool
|
||||
for _, allowRegex := range cfg.ConfigFile.AllowLists {
|
||||
if regexp.MustCompile(allowRegex).MatchString(domain) {
|
||||
skip = true
|
||||
continue
|
||||
}
|
||||
}
|
||||
if skip {
|
||||
fmt.Printf(".")
|
||||
continue
|
||||
}
|
||||
|
||||
// add domain
|
||||
cleanDomains = append(cleanDomains, domain)
|
||||
|
Reference in New Issue
Block a user