forked from quic-go/quic-go
ci: enable the nolintlint linter (#5221)
This linter helps us find unneeded nolint statements.
This commit is contained in:
@@ -9,6 +9,7 @@ linters:
|
|||||||
- govet
|
- govet
|
||||||
- ineffassign
|
- ineffassign
|
||||||
- misspell
|
- misspell
|
||||||
|
- nolintlint
|
||||||
- prealloc
|
- prealloc
|
||||||
- staticcheck
|
- staticcheck
|
||||||
- unconvert
|
- unconvert
|
||||||
|
|||||||
@@ -701,8 +701,6 @@ runLoop:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// blocks until the early connection can be used
|
// blocks until the early connection can be used
|
||||||
//
|
|
||||||
//nolint:unused // False positive: This function is used by Transport.doDial.
|
|
||||||
func (c *Conn) earlyConnReady() <-chan struct{} {
|
func (c *Conn) earlyConnReady() <-chan struct{} {
|
||||||
return c.earlyConnReadyChan
|
return c.earlyConnReadyChan
|
||||||
}
|
}
|
||||||
@@ -1992,7 +1990,6 @@ func (c *Conn) triggerSending(now time.Time) error {
|
|||||||
c.pacingDeadline = time.Time{}
|
c.pacingDeadline = time.Time{}
|
||||||
|
|
||||||
sendMode := c.sentPacketHandler.SendMode(now)
|
sendMode := c.sentPacketHandler.SendMode(now)
|
||||||
//nolint:exhaustive // No need to handle pacing limited here.
|
|
||||||
switch sendMode {
|
switch sendMode {
|
||||||
case ackhandler.SendAny:
|
case ackhandler.SendAny:
|
||||||
return c.sendPackets(now)
|
return c.sendPackets(now)
|
||||||
|
|||||||
@@ -229,7 +229,7 @@ func TestContextOnClientSide(t *testing.T) {
|
|||||||
return &tlsServerConf.Certificates[0], nil
|
return &tlsServerConf.Certificates[0], nil
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx, cancel := context.WithCancel(context.WithValue(context.Background(), "foo", "bar")) //nolint:staticcheck
|
ctx, cancel := context.WithCancel(context.WithValue(context.Background(), "foo", "bar"))
|
||||||
conn, err := quic.Dial(
|
conn, err := quic.Dial(
|
||||||
ctx,
|
ctx,
|
||||||
newUDPConnLocalhost(t),
|
newUDPConnLocalhost(t),
|
||||||
|
|||||||
@@ -675,7 +675,7 @@ func TestHTTPConnContext(t *testing.T) {
|
|||||||
func(s *http3.Server) {
|
func(s *http3.Server) {
|
||||||
s.ConnContext = func(ctx context.Context, c *quic.Conn) context.Context {
|
s.ConnContext = func(ctx context.Context, c *quic.Conn) context.Context {
|
||||||
connCtxChan <- ctx
|
connCtxChan <- ctx
|
||||||
ctx = context.WithValue(ctx, "foo", "bar") //nolint:staticcheck
|
ctx = context.WithValue(ctx, "foo", "bar")
|
||||||
return ctx
|
return ctx
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ func IsValidVersion(v Version) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (vn Version) String() string {
|
func (vn Version) String() string {
|
||||||
//nolint:exhaustive
|
|
||||||
switch vn {
|
switch vn {
|
||||||
case VersionUnknown:
|
case VersionUnknown:
|
||||||
return "unknown"
|
return "unknown"
|
||||||
|
|||||||
@@ -61,7 +61,6 @@ func (h *ExtendedHeader) Append(b []byte, v protocol.Version) ([]byte, error) {
|
|||||||
|
|
||||||
var packetType uint8
|
var packetType uint8
|
||||||
if v == protocol.Version2 {
|
if v == protocol.Version2 {
|
||||||
//nolint:exhaustive
|
|
||||||
switch h.Type {
|
switch h.Type {
|
||||||
case protocol.PacketTypeInitial:
|
case protocol.PacketTypeInitial:
|
||||||
packetType = 0b01
|
packetType = 0b01
|
||||||
@@ -73,7 +72,6 @@ func (h *ExtendedHeader) Append(b []byte, v protocol.Version) ([]byte, error) {
|
|||||||
packetType = 0b00
|
packetType = 0b00
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//nolint:exhaustive
|
|
||||||
switch h.Type {
|
switch h.Type {
|
||||||
case protocol.PacketTypeInitial:
|
case protocol.PacketTypeInitial:
|
||||||
packetType = 0b00
|
packetType = 0b00
|
||||||
|
|||||||
@@ -318,7 +318,6 @@ func (s congestionState) String() string {
|
|||||||
type ecn logging.ECN
|
type ecn logging.ECN
|
||||||
|
|
||||||
func (e ecn) String() string {
|
func (e ecn) String() string {
|
||||||
//nolint:exhaustive // The unsupported value is never logged.
|
|
||||||
switch logging.ECN(e) {
|
switch logging.ECN(e) {
|
||||||
case logging.ECTNot:
|
case logging.ECTNot:
|
||||||
return "Not-ECT"
|
return "Not-ECT"
|
||||||
|
|||||||
Reference in New Issue
Block a user