From f96a74fc1aaa9575be923d9d65c816772d5253fb Mon Sep 17 00:00:00 2001 From: Tamal Saha Date: Sat, 11 Jul 2026 17:34:24 +0600 Subject: [PATCH] Modernize golangci-lint config - Enable bodyclose and prealloc linters - Move exclude-files/exclude-dirs to linters.exclusions.paths (golangci-lint v2 location) and fix over-escaped regex generated.*\\.go -> generated.*\.go - Switch formatter from gofmt to gofumpt and drop the interface{} -> any rewrite rule (gofumpt is a stricter superset) - Apply resulting gofumpt formatting Signed-off-by: Tamal Saha --- .golangci.yml | 21 ++++++++------------- pkg/cmds/debug/gateway/config_dump.go | 3 ++- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index cdd2defce..1ebcfa46a 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -2,27 +2,22 @@ version: "2" linters: default: standard enable: + - bodyclose + - prealloc - unparam + exclusions: + paths: + - generated.*\.go + - client + - vendor formatters: enable: - - gofmt + - gofumpt - goimports - settings: - gofmt: - rewrite-rules: - - pattern: 'interface{}' - replacement: 'any' issues: max-same-issues: 100 - exclude-files: - - generated.*\\.go - - exclude-dirs: - - client - - vendor - run: timeout: 10m diff --git a/pkg/cmds/debug/gateway/config_dump.go b/pkg/cmds/debug/gateway/config_dump.go index d1ce17e16..bd1484274 100644 --- a/pkg/cmds/debug/gateway/config_dump.go +++ b/pkg/cmds/debug/gateway/config_dump.go @@ -78,7 +78,8 @@ func (g *gatewayOpts) forwardToPort(podMeta metav1.ObjectMeta, resource string, Namespace: podMeta.Namespace, Name: podMeta.Name, Remote: *port, - }) + }, + ) if err := tunnel.ForwardPort(); err != nil { return nil, err }