* reduce staticcheck warnings
This commit is contained in:
Jay Wren
2025-04-02 16:24:03 -04:00
parent 18279ed17b
commit 2400e2392b
45 changed files with 158 additions and 208 deletions

View File

@@ -30,15 +30,11 @@ func (NoopConn) Rebind() error {
func (NoopConn) LocalAddr() (netip.AddrPort, error) {
return netip.AddrPort{}, nil
}
func (NoopConn) ListenOut(_ EncReader) {
return
}
func (NoopConn) ListenOut(_ EncReader) {}
func (NoopConn) WriteTo(_ []byte, _ netip.AddrPort) error {
return nil
}
func (NoopConn) ReloadConfig(_ *config.C) {
return
}
func (NoopConn) ReloadConfig(_ *config.C) {}
func (NoopConn) Close() error {
return nil
}

View File

@@ -33,7 +33,7 @@ func NewGenericListener(l *logrus.Logger, ip netip.Addr, port int, multi bool, b
if uc, ok := pc.(*net.UDPConn); ok {
return &GenericConn{UDPConn: uc, l: l}, nil
}
return nil, fmt.Errorf("Unexpected PacketConn: %T %#v", pc, pc)
return nil, fmt.Errorf("unexpected PacketConn: %T %#v", pc, pc)
}
func (u *GenericConn) WriteTo(b []byte, addr netip.AddrPort) error {
@@ -66,10 +66,6 @@ func NewUDPStatsEmitter(udpConns []Conn) func() {
return func() {}
}
type rawMessage struct {
Len uint32
}
func (u *GenericConn) ListenOut(r EncReader) {
buffer := make([]byte, MTU)