Files
ddns-updater/internal/helpers.go

21 lines
391 B
Go
Raw Normal View History

2023-04-28 14:57:21 +02:00
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
}