ci: upgrade golangci-lint to v2.13.1

Preparatory MR for !2924 (merged), which bumps the default CI Go version to 1.26.

golangci-lint v2.5.0 is built with go1.25, so as soon as a job runs on the golang:1.26 image its type checker panics before linting anything:

panic: file requires newer Go version go1.26 (application built with go1.25)

v2.13.1 is the current release and is built with go1.27, so it covers both the current (1.26) and next (1.27) versions !2924 (merged) introduces.

Findings

The upgrade surfaces 40 findings that v2.5.0 did not report (v2.5.0 reports 0 issues on the same tree). Most are formatting-only and were applied with golangci-lint run --fix. Four needed a judgement call:

Finding Resolution
manifests.go gosec G705 nolint — the payload is written with an explicit Content-Type, so it is never sniffed as HTML
registry.go staticcheck SA1019 nolint — the CertPool.Subjects deprecation only concerns pools from x509.SystemCertPool
retry_notification_policy.go staticcheck SA4023 nolint — the nil guard is dead code today, but keeps the later err.Error() call safe
health/db.go gosec G705 Fixed — this endpoint echoes r.Method back to the caller, so the response now pins Content-Type: text/plain rather than leaving the reflected value to content sniffing

The gofumpt extra-rules setting is also migrated to extra.group-params, which replaces it in this release and is what drives most of the formatting churn.

golangci-lint run reports 0 issues after these changes.

Related to #2372 (closed).

🤖 Generated with Claude Code

Merge request reports

Loading
Loading