From 9d0bff54bf0104b3dca52fece7e0cc829a374bc6 Mon Sep 17 00:00:00 2001 From: Sean DuBois Date: Sat, 16 Mar 2024 19:46:26 -0400 Subject: [PATCH] Fix linter errors golangci-lint upgrade to v1.56.2 added more checks Relates to pion/.goassets#201 --- conn.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/conn.go b/conn.go index 7a9435d..0437e70 100644 --- a/conn.go +++ b/conn.go @@ -4,7 +4,6 @@ package mdns import ( - "bytes" "context" "errors" "fmt" @@ -825,11 +824,10 @@ func (c *Conn) readLoop(name string, pktConn ipPacketConn, inboundBufferSize int // multicast address 224.0.0.251 or its IPv6 equivalent FF02::FB, except // when generating a reply to a query that explicitly requested a // unicast response - shouldUnicastResponse := - (q.Class&(1<<15)) != 0 || // via the unicast-response bit - srcAddr.Port != 5353 || // by virtue of being a legacy query (Section 6.7), or - (len(pktDst) != 0 && !(bytes.Equal(pktDst, c.dstAddr4.IP) || // by virtue of being a direct unicast query - bytes.Equal(pktDst, c.dstAddr6.IP))) + shouldUnicastResponse := (q.Class&(1<<15)) != 0 || // via the unicast-response bit + srcAddr.Port != 5353 || // by virtue of being a legacy query (Section 6.7), or + (len(pktDst) != 0 && !(pktDst.Equal(c.dstAddr4.IP) || // by virtue of being a direct unicast query + pktDst.Equal(c.dstAddr6.IP))) var dst *net.UDPAddr if shouldUnicastResponse { dst = srcAddr