]> git.feebdaed.xyz Git - 0xmirror/quic-go.git/commitdiff
ci: enable the nolintlint linter (#5221)
authorMarten Seemann <martenseemann@gmail.com>
Wed, 11 Jun 2025 04:52:21 +0000 (12:52 +0800)
committerGitHub <noreply@github.com>
Wed, 11 Jun 2025 04:52:21 +0000 (06:52 +0200)
This linter helps us find unneeded nolint statements.

.golangci.yml
connection.go
integrationtests/self/handshake_context_test.go
integrationtests/self/http_test.go
internal/protocol/version.go
internal/wire/extended_header.go
qlog/types.go

index e4295dfbebf56dd35a04659526a1f58aedd667fe..e045e5e052ba909358fcbca9e1fc0ae7cbdb945c 100644 (file)
@@ -9,6 +9,7 @@ linters:
     - govet
     - ineffassign
     - misspell
+    - nolintlint
     - prealloc
     - staticcheck
     - unconvert
index 34267b3a1fc726b9c435d706f7fd96cfae5444d6..056cdb7405a89e1398535fdd677634bc8414821e 100644 (file)
@@ -701,8 +701,6 @@ runLoop:
 }
 
 // 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{} {
        return c.earlyConnReadyChan
 }
@@ -1992,7 +1990,6 @@ func (c *Conn) triggerSending(now time.Time) error {
        c.pacingDeadline = time.Time{}
 
        sendMode := c.sentPacketHandler.SendMode(now)
-       //nolint:exhaustive // No need to handle pacing limited here.
        switch sendMode {
        case ackhandler.SendAny:
                return c.sendPackets(now)
index 80da977ce9ab79aea14d49e5a9ca0612aee74e6f..21b6deff8875b1236c575dadd2b763969b4aa8ac 100644 (file)
@@ -229,7 +229,7 @@ func TestContextOnClientSide(t *testing.T) {
                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(
                ctx,
                newUDPConnLocalhost(t),
index b0da43c9f0e8b301f1368445892e6fb4782c6634..65b992ce5fa6139a1cd5de97dda796a9637c914f 100644 (file)
@@ -675,7 +675,7 @@ func TestHTTPConnContext(t *testing.T) {
                func(s *http3.Server) {
                        s.ConnContext = func(ctx context.Context, c *quic.Conn) context.Context {
                                connCtxChan <- ctx
-                               ctx = context.WithValue(ctx, "foo", "bar") //nolint:staticcheck
+                               ctx = context.WithValue(ctx, "foo", "bar")
                                return ctx
                        }
                },
index c9254a045e7d3775f82b50c887cbfcf1189e71e6..8abca5060b0969ab30306f6967aa4df61b6c5841 100644 (file)
@@ -37,7 +37,6 @@ func IsValidVersion(v Version) bool {
 }
 
 func (vn Version) String() string {
-       //nolint:exhaustive
        switch vn {
        case VersionUnknown:
                return "unknown"
index 1c6ad991dbe517c4323936e18ee5957cb1077088..6ab9fb98ace9058e1385a3030e780ac13beb9ec6 100644 (file)
@@ -61,7 +61,6 @@ func (h *ExtendedHeader) Append(b []byte, v protocol.Version) ([]byte, error) {
 
        var packetType uint8
        if v == protocol.Version2 {
-               //nolint:exhaustive
                switch h.Type {
                case protocol.PacketTypeInitial:
                        packetType = 0b01
@@ -73,7 +72,6 @@ func (h *ExtendedHeader) Append(b []byte, v protocol.Version) ([]byte, error) {
                        packetType = 0b00
                }
        } else {
-               //nolint:exhaustive
                switch h.Type {
                case protocol.PacketTypeInitial:
                        packetType = 0b00
index d0ff7ae6e989f2e75d7acd6856c0f21b4fd03b53..acffb64695102d761de7baf4ba86f1a37d1dcad4 100644 (file)
@@ -318,7 +318,6 @@ func (s congestionState) String() string {
 type ecn logging.ECN
 
 func (e ecn) String() string {
-       //nolint:exhaustive // The unsupported value is never logged.
        switch logging.ECN(e) {
        case logging.ECTNot:
                return "Not-ECT"