make ttl an int if it is an int
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

Signed-off-by: Sam Therapy <sam@samtherapy.net>
This commit is contained in:
Sam Therapy 2022-12-17 16:32:01 +01:00
parent 8aad12c7ef
commit 9f517424d0
Signed by: sam
GPG key ID: 4D8B07C18F31ACBD

View file

@ -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
}
}