Skip to content

Commit 5ef74ae

Browse files
author
wafuwafu13
committed
use equal instead of strings.Contains
1 parent 5c2e009 commit 5ef74ae

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

check-dns/lib/check_dns.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ func (opts *dnsOpts) run() *checkers.Checker {
9090
match := 0
9191
for _, v := range opts.ExpectedAddress {
9292
for _, answer := range r.Answer {
93-
if strings.Contains(answer.String(), strings.TrimSpace(v)) {
93+
// strings.Split(answer.String(), "\t") is formatted as [a.root-servers.net. 328177 IN A 198.41.0.4]
94+
if strings.Split(answer.String(), "\t")[4] == strings.TrimSpace(v) {
9495
match += 1
9596
}
9697
}

0 commit comments

Comments
 (0)