From cfc4d09003d601d73af8a6880dd0946b91836398 Mon Sep 17 00:00:00 2001 From: grumbulon Date: Thu, 15 Dec 2022 19:28:36 -0500 Subject: [PATCH] oops, accidentally was racist --- pkg/query/util.go | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/pkg/query/util.go b/pkg/query/util.go index 393fae6..a8c07a2 100644 --- a/pkg/query/util.go +++ b/pkg/query/util.go @@ -12,13 +12,13 @@ import ( "golang.org/x/net/idna" ) -var ( - ttl any - name string - err error -) - func (message *Message) displayQuestion(msg *dns.Msg, opts *util.Options, opt *dns.OPT) error { + + var ( + name string + err error + ) + for _, question := range msg.Question { if opts.Display.UcodeTranslate { name, err = idna.ToUnicode(question.Name) @@ -40,6 +40,13 @@ func (message *Message) displayQuestion(msg *dns.Msg, opts *util.Options, opt *d } func (message *Message) displayAnswers(msg *dns.Msg, opts *util.Options, opt *dns.OPT) error { + + var ( + ttl any + name string + err error + ) + for _, answer := range msg.Answer { temp := strings.Split(answer.String(), "\t") @@ -77,6 +84,13 @@ func (message *Message) displayAnswers(msg *dns.Msg, opts *util.Options, opt *dn } func (message *Message) displayAuthority(msg *dns.Msg, opts *util.Options, opt *dns.OPT) error { + + var ( + ttl any + name string + err error + ) + for _, ns := range msg.Ns { temp := strings.Split(ns.String(), "\t") @@ -114,6 +128,13 @@ func (message *Message) displayAuthority(msg *dns.Msg, opts *util.Options, opt * } func (message *Message) displayAdditional(msg *dns.Msg, opts *util.Options, opt *dns.OPT) error { + + var ( + ttl any + name string + err error + ) + for _, additional := range msg.Extra { if additional.Header().Rrtype == dns.StringToType["OPT"] { continue