ci: update golangci-lint to v2 (#5007)

This commit is contained in:
Marten Seemann
2025-03-30 12:16:14 +07:00
committed by GitHub
parent 4290638b55
commit 1d8f3f281a
24 changed files with 126 additions and 116 deletions

View File

@@ -131,7 +131,7 @@ func newBrokenConn(conn net.PacketConn) *brokenConn {
go func() {
<-c.broken
// make calls to ReadFrom return
c.PacketConn.SetDeadline(time.Now())
c.SetDeadline(time.Now())
}()
return c
}

View File

@@ -50,7 +50,7 @@ func (ln *fakeClosingListener) Accept(ctx context.Context) (quic.EarlyConnection
func (ln *fakeClosingListener) Close() error {
if ln.closed.CompareAndSwap(false, true) {
ln.cancel()
if ln.listenerWrapper.count.Add(-1) == 0 {
if ln.count.Add(-1) == 0 {
ln.listenerWrapper.Close()
}
}

View File

@@ -326,10 +326,7 @@ func TestMultiplexingNonQUICPackets(t *testing.T) {
minExpected := numPackets * 4 / 5
timeout := time.After(time.Second)
var counter int
for {
if counter >= minExpected {
break
}
for counter < minExpected {
select {
case p := <-rcvdPackets:
require.Equal(t, tr1.Conn.LocalAddr(), p.addr, "non-QUIC packet received from wrong address")

View File

@@ -332,7 +332,7 @@ func Test0RTTWaitForHandshakeCompletion(t *testing.T) {
// check that 0-RTT packets only contain STREAM frames for the first stream
var num0RTT int
for _, p := range counter.getRcvdLongHeaderPackets() {
if p.hdr.Header.Type != protocol.PacketType0RTT {
if p.hdr.Type != protocol.PacketType0RTT {
continue
}
for _, f := range p.frames {