This commit is contained in:
mkelcik
2023-04-28 14:57:21 +02:00
parent 531b3fba51
commit ec9ca7183c
7 changed files with 270 additions and 0 deletions

20
internal/helpers.go Normal file
View File

@@ -0,0 +1,20 @@
package internal
import "strings"
func parseDNSToCheck(data string) []string {
out := make([]string, 0, strings.Count(data, ",")+1)
for _, dns := range strings.Split(data, ",") {
out = append(out, strings.TrimSpace(dns))
}
return out
}
func Contains[T comparable](haystack []T, needle T) bool {
for _, v := range haystack {
if v == needle {
return true
}
}
return false
}