From 9f517424d0f6cb5b77dd28559e2418f965a3e18b Mon Sep 17 00:00:00 2001 From: Sam Therapy Date: Sat, 17 Dec 2022 16:32:01 +0100 Subject: [PATCH] make ttl an int if it is an int Signed-off-by: Sam Therapy --- pkg/query/util.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkg/query/util.go b/pkg/query/util.go index 97b52c6..4df5e97 100644 --- a/pkg/query/util.go +++ b/pkg/query/util.go @@ -3,7 +3,6 @@ package query import ( "encoding/hex" "fmt" - "strconv" "strings" "time" @@ -52,7 +51,7 @@ func (message *Message) displayAnswers(msg *dns.Msg, opts *util.Options, opt *dn if opts.Display.HumanTTL { ttl = (time.Duration(answer.Header().Ttl) * time.Second).String() } else { - ttl = strconv.Itoa(int(answer.Header().Ttl)) + ttl = answer.Header().Ttl } } @@ -95,7 +94,7 @@ func (message *Message) displayAuthority(msg *dns.Msg, opts *util.Options, opt * if opts.Display.HumanTTL { ttl = (time.Duration(ns.Header().Ttl) * time.Second).String() } else { - ttl = strconv.Itoa(int(ns.Header().Ttl)) + ttl = ns.Header().Ttl } } @@ -141,7 +140,7 @@ func (message *Message) displayAdditional(msg *dns.Msg, opts *util.Options, opt if opts.Display.HumanTTL { ttl = (time.Duration(additional.Header().Ttl) * time.Second).String() } else { - ttl = strconv.Itoa(int(additional.Header().Ttl)) + ttl = additional.Header().Ttl } }