mirror of
https://github.com/Luzifer/named-blacklist.git
synced 2024-11-09 16:00:09 +00:00
Collect comments for all sources
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
2a224984a5
commit
9d52d69430
2 changed files with 15 additions and 3 deletions
18
main.go
18
main.go
|
@ -4,6 +4,7 @@ import (
|
|||
"fmt"
|
||||
"os"
|
||||
"sort"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
@ -105,14 +106,25 @@ func main() {
|
|||
}
|
||||
|
||||
func addIfNotExists(entries []entry, e entry) []entry {
|
||||
var (
|
||||
found bool
|
||||
out []entry
|
||||
)
|
||||
|
||||
for _, pe := range entries {
|
||||
if pe.Domain == e.Domain {
|
||||
// Entry already exists, skip
|
||||
return entries
|
||||
found = true
|
||||
pe.Comment = strings.Join([]string{pe.Comment, e.Comment}, ", ")
|
||||
}
|
||||
|
||||
out = append(out, pe)
|
||||
}
|
||||
|
||||
return append(entries, e)
|
||||
if !found {
|
||||
out = append(out, e)
|
||||
}
|
||||
|
||||
return out
|
||||
}
|
||||
|
||||
func cleanFromList(blacklist, whitelist []entry) []entry {
|
||||
|
|
BIN
named-blacklist
BIN
named-blacklist
Binary file not shown.
Loading…
Reference in a new issue