From 3ae0d45f9aaf27ad3d7dbb2d213ac3c4617a5ac1 Mon Sep 17 00:00:00 2001 From: Nate Sales Date: Sat, 24 Aug 2024 22:46:16 -0700 Subject: [PATCH] refactor: log unknown integer RR types as TYPE%d --- main.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 0e4add8..06fc074 100644 --- a/main.go +++ b/main.go @@ -319,7 +319,11 @@ All long form (--) flags can be toggled with the dig-standard +[no]flag notation log.Debugf("Name: %s", opts.Name) var rrTypeStrings []string for rrType := range rrTypes { - rrTypeStrings = append(rrTypeStrings, dns.TypeToString[rrType]) + rrS, ok := dns.TypeToString[rrType] + if !ok { + rrS = fmt.Sprintf("TYPE%d", rrType) + } + rrTypeStrings = append(rrTypeStrings, rrS) } log.Debugf("RR types: %+v", rrTypeStrings) }