forked from quic-go/quic-go
ci: update golangci-lint to v2 (#5007)
This commit is contained in:
@@ -61,8 +61,8 @@ func (c *connectionFlowController) AddBytesRead(n protocol.ByteCount) (hasWindow
|
||||
c.mutex.Lock()
|
||||
defer c.mutex.Unlock()
|
||||
|
||||
c.baseFlowController.addBytesRead(n)
|
||||
return c.baseFlowController.hasWindowUpdate()
|
||||
c.addBytesRead(n)
|
||||
return c.hasWindowUpdate()
|
||||
}
|
||||
|
||||
func (c *connectionFlowController) GetWindowUpdate(now time.Time) protocol.ByteCount {
|
||||
@@ -70,7 +70,7 @@ func (c *connectionFlowController) GetWindowUpdate(now time.Time) protocol.ByteC
|
||||
defer c.mutex.Unlock()
|
||||
|
||||
oldWindowSize := c.receiveWindowSize
|
||||
offset := c.baseFlowController.getWindowUpdate(now)
|
||||
offset := c.getWindowUpdate(now)
|
||||
if c.logger.Debug() && oldWindowSize < c.receiveWindowSize {
|
||||
c.logger.Debugf("Increasing receive flow control window for the connection to %d kB", c.receiveWindowSize/(1<<10))
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ func (c *streamFlowController) UpdateHighestReceived(offset protocol.ByteCount,
|
||||
|
||||
func (c *streamFlowController) AddBytesRead(n protocol.ByteCount) (hasStreamWindowUpdate, hasConnWindowUpdate bool) {
|
||||
c.mutex.Lock()
|
||||
c.baseFlowController.addBytesRead(n)
|
||||
c.addBytesRead(n)
|
||||
hasStreamWindowUpdate = c.shouldQueueWindowUpdate()
|
||||
c.mutex.Unlock()
|
||||
hasConnWindowUpdate = c.connection.AddBytesRead(n)
|
||||
@@ -145,7 +145,7 @@ func (c *streamFlowController) GetWindowUpdate(now time.Time) protocol.ByteCount
|
||||
defer c.mutex.Unlock()
|
||||
|
||||
oldWindowSize := c.receiveWindowSize
|
||||
offset := c.baseFlowController.getWindowUpdate(now)
|
||||
offset := c.getWindowUpdate(now)
|
||||
if c.receiveWindowSize > oldWindowSize { // auto-tuning enlarged the window size
|
||||
c.logger.Debugf("Increasing receive flow control window for stream %d to %d", c.streamID, c.receiveWindowSize)
|
||||
c.connection.EnsureMinimumWindowSize(protocol.ByteCount(float64(c.receiveWindowSize)*protocol.ConnectionFlowControlMultiplier), now)
|
||||
|
||||
@@ -129,7 +129,7 @@ func TestHandshakeTimeoutError(t *testing.T) {
|
||||
require.True(t, errors.Is(&HandshakeTimeoutError{}, &HandshakeTimeoutError{}))
|
||||
require.False(t, errors.Is(&HandshakeTimeoutError{}, &IdleTimeoutError{}))
|
||||
|
||||
//nolint:gosimple // we need to assign to an interface here
|
||||
//nolint:staticcheck // SA1021: we need to assign to an interface here
|
||||
var err error
|
||||
err = &HandshakeTimeoutError{}
|
||||
nerr, ok := err.(net.Error)
|
||||
@@ -143,7 +143,7 @@ func TestIdleTimeoutError(t *testing.T) {
|
||||
require.True(t, errors.Is(&IdleTimeoutError{}, &IdleTimeoutError{}))
|
||||
require.False(t, errors.Is(&IdleTimeoutError{}, &HandshakeTimeoutError{}))
|
||||
|
||||
//nolint:gosimple // we need to assign to an interface here
|
||||
//nolint:staticcheck // SA1021: we need to assign to an interface here
|
||||
var err error
|
||||
err = &IdleTimeoutError{}
|
||||
nerr, ok := err.(net.Error)
|
||||
@@ -166,7 +166,7 @@ func TestStatelessResetError(t *testing.T) {
|
||||
require.Equal(t, "received a stateless reset", (&StatelessResetError{}).Error())
|
||||
require.True(t, errors.Is(&StatelessResetError{}, &StatelessResetError{}))
|
||||
|
||||
//nolint:gosimple // we need to assign to an interface here
|
||||
//nolint:staticcheck // SA1021: we need to assign to an interface here
|
||||
var err error
|
||||
err = &StatelessResetError{}
|
||||
nerr, ok := err.(net.Error)
|
||||
|
||||
@@ -19,7 +19,7 @@ func NewBufferedWriteCloser(writer *bufio.Writer, closer io.Closer) io.WriteClos
|
||||
}
|
||||
|
||||
func (h bufferedWriteCloser) Close() error {
|
||||
if err := h.Writer.Flush(); err != nil {
|
||||
if err := h.Flush(); err != nil {
|
||||
return err
|
||||
}
|
||||
return h.Closer.Close()
|
||||
|
||||
@@ -30,7 +30,7 @@ func parseNewConnectionIDFrame(b []byte, _ protocol.Version) (*NewConnectionIDFr
|
||||
}
|
||||
b = b[l:]
|
||||
if ret > seq {
|
||||
//nolint:stylecheck
|
||||
//nolint:staticcheck // SA1021: Retire Prior To is the name of the field
|
||||
return nil, 0, fmt.Errorf("Retire Prior To value (%d) larger than Sequence Number (%d)", ret, seq)
|
||||
}
|
||||
if len(b) == 0 {
|
||||
|
||||
@@ -16,11 +16,11 @@ func ParseVersionNegotiationPacket(b []byte) (dest, src protocol.ArbitraryLenCon
|
||||
}
|
||||
b = b[n:]
|
||||
if len(b) == 0 {
|
||||
//nolint:stylecheck
|
||||
//nolint:staticcheck // SA1021: the packet is called Version Negotiation packet
|
||||
return nil, nil, nil, errors.New("Version Negotiation packet has empty version list")
|
||||
}
|
||||
if len(b)%4 != 0 {
|
||||
//nolint:stylecheck
|
||||
//nolint:staticcheck // SA1021: the packet is called Version Negotiation packet
|
||||
return nil, nil, nil, errors.New("Version Negotiation packet has a version list with an invalid length")
|
||||
}
|
||||
versions := make([]protocol.Version, len(b)/4)
|
||||
|
||||
Reference in New Issue
Block a user