Fix lint errors

This commit is contained in:
Neil Alexander 2021-06-02 14:40:09 +01:00
parent 166336a418
commit 8932ab0519
14 changed files with 44 additions and 54 deletions

View file

@ -91,7 +91,7 @@ func (m *Multicast) _start() error {
return err
}
m.sock = ipv6.NewPacketConn(conn)
if err = m.sock.SetControlMessage(ipv6.FlagDst, true); err != nil {
if err = m.sock.SetControlMessage(ipv6.FlagDst, true); err != nil { // nolint:staticcheck
// Windows can't set this flag, so we need to handle it in other ways
}
@ -269,7 +269,7 @@ func (m *Multicast) _announce() {
continue
}
// Join the multicast group
m.sock.JoinGroup(&iface, groupAddr)
_ = m.sock.JoinGroup(&iface, groupAddr)
// Try and see if we already have a TCP listener for this interface
var info *listenerInfo
if nfo, ok := m.listeners[iface.Name]; !ok || nfo.listener.Listener == nil {
@ -304,7 +304,7 @@ func (m *Multicast) _announce() {
a.Zone = ""
destAddr.Zone = iface.Name
msg := []byte(a.String())
m.sock.WriteTo(msg, nil, destAddr)
_, _ = m.sock.WriteTo(msg, nil, destAddr)
}
if info.interval.Seconds() < 15 {
info.interval += time.Second