corrects incorrectly scoped continue

This commit is contained in:
2025-06-27 17:35:27 -05:00
parent e708807feb
commit 943ba1e819

View File

@ -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)