From 8ecea94310b46a8f5392e51a2a74f5222efcd3a5 Mon Sep 17 00:00:00 2001 From: Matt Burchett Date: Fri, 30 Nov 2018 11:47:01 -0600 Subject: [PATCH] Test --- pkg/resolver/resolver.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/pkg/resolver/resolver.go b/pkg/resolver/resolver.go index c52c7d1..0377683 100644 --- a/pkg/resolver/resolver.go +++ b/pkg/resolver/resolver.go @@ -66,7 +66,20 @@ func PerformZoneTransfer(config config.Config) { default: continue } - data = append(data, fmt.Sprintf("%v %v %v\n", hostname, ip, txt)) + // data = append(data, fmt.Sprintf("%v %v %v\n", strings.TrimRight(hostname, "."), ip, txt)) + + for _, i := range data { + checkval := fmt.Sprintf("%v %v ", strings.TrimRight(hostname, "."), ip) + actualval := fmt.Sprintf("%v %v %v", strings.TrimRight(hostname, "."), ip, txt) + if i == checkval { + if i != actualval { + i = actualval + } + + } else { + data = append(data, fmt.Sprintf("%v %v %v\n", strings.TrimRight(hostname, "."), ip, txt)) + } + } } } }