diff --git a/cmd/cli.go b/cmd/cli.go index 3c06037..4dcf875 100644 --- a/cmd/cli.go +++ b/cmd/cli.go @@ -17,7 +17,7 @@ import ( // ParseCLI parses arguments given from the CLI and passes them into an `Options` // struct. -func ParseCLI(args []string, version string) (*util.Options, error) { +func ParseCLI(args []string, version string) (opts *util.Options, err error) { // Parse the standard flags opts, misc, err := parseFlags(args, version) if err != nil { diff --git a/pkg/query/print.go b/pkg/query/print.go index 33734d6..8171ed9 100644 --- a/pkg/query/print.go +++ b/pkg/query/print.go @@ -21,15 +21,12 @@ import ( // ToString turns the response into something that looks a lot like dig // // Much of this is taken from https://github.com/miekg/dns/blob/master/msg.go#L900 -func ToString(res util.Response, opts *util.Options) (string, error) { +func ToString(res util.Response, opts *util.Options) (s string, err error) { if res.DNS == nil { return " MsgHdr", errNoMessage } - var ( - s string - opt *dns.OPT - ) + var opt *dns.OPT if !opts.Short { if opts.Display.Comments { diff --git a/pkg/resolvers/DNSCrypt.go b/pkg/resolvers/DNSCrypt.go index 9bff6bd..a80df61 100644 --- a/pkg/resolvers/DNSCrypt.go +++ b/pkg/resolvers/DNSCrypt.go @@ -19,7 +19,7 @@ type DNSCryptResolver struct { var _ Resolver = (*DNSCryptResolver)(nil) // LookUp performs a DNS query. -func (resolver *DNSCryptResolver) LookUp(msg *dns.Msg) (util.Response, error) { +func (resolver *DNSCryptResolver) LookUp(msg *dns.Msg) (resp util.Response, err error) { client := dnscrypt.Client{ Timeout: resolver.opts.Request.Timeout, UDPSize: 1232, diff --git a/pkg/resolvers/HTTPS.go b/pkg/resolvers/HTTPS.go index bfe1660..9182095 100644 --- a/pkg/resolvers/HTTPS.go +++ b/pkg/resolvers/HTTPS.go @@ -23,9 +23,7 @@ type HTTPSResolver struct { var _ Resolver = (*HTTPSResolver)(nil) // LookUp performs a DNS query. -func (resolver *HTTPSResolver) LookUp(msg *dns.Msg) (util.Response, error) { - var resp util.Response - +func (resolver *HTTPSResolver) LookUp(msg *dns.Msg) (resp util.Response, err error) { resolver.client = http.Client{ Timeout: resolver.opts.Request.Timeout, Transport: &http.Transport{ diff --git a/pkg/resolvers/QUIC.go b/pkg/resolvers/QUIC.go index 53b96b7..c24c0e8 100644 --- a/pkg/resolvers/QUIC.go +++ b/pkg/resolvers/QUIC.go @@ -22,9 +22,7 @@ type QUICResolver struct { var _ Resolver = (*QUICResolver)(nil) // LookUp performs a DNS query. -func (resolver *QUICResolver) LookUp(msg *dns.Msg) (util.Response, error) { - var resp util.Response - +func (resolver *QUICResolver) LookUp(msg *dns.Msg) (resp util.Response, err error) { tls := &tls.Config{ //nolint:gosec // This is intentional if the user requests it InsecureSkipVerify: resolver.opts.TLSNoVerify, diff --git a/pkg/resolvers/general.go b/pkg/resolvers/general.go index e4a9435..39b7a03 100644 --- a/pkg/resolvers/general.go +++ b/pkg/resolvers/general.go @@ -19,12 +19,7 @@ type StandardResolver struct { var _ Resolver = (*StandardResolver)(nil) // LookUp performs a DNS query. -func (resolver *StandardResolver) LookUp(msg *dns.Msg) (util.Response, error) { - var ( - resp util.Response - err error - ) - +func (resolver *StandardResolver) LookUp(msg *dns.Msg) (resp util.Response, err error) { dnsClient := new(dns.Client) dnsClient.Dialer = &net.Dialer{ Timeout: resolver.opts.Request.Timeout,