Skip to content

Commit efe4965

Browse files
authored
Modernize golangci-lint config (#50)
- 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 <tamal@appscode.com>
1 parent 2e59271 commit efe4965

2 files changed

Lines changed: 10 additions & 14 deletions

File tree

.golangci.yml

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,22 @@ version: "2"
22
linters:
33
default: standard
44
enable:
5+
- bodyclose
6+
- prealloc
57
- unparam
8+
exclusions:
9+
paths:
10+
- generated.*\.go
11+
- client
12+
- vendor
613

714
formatters:
815
enable:
9-
- gofmt
16+
- gofumpt
1017
- goimports
11-
settings:
12-
gofmt:
13-
rewrite-rules:
14-
- pattern: 'interface{}'
15-
replacement: 'any'
1618

1719
issues:
1820
max-same-issues: 100
1921

20-
exclude-files:
21-
- generated.*\\.go
22-
23-
exclude-dirs:
24-
- client
25-
- vendor
26-
2722
run:
2823
timeout: 10m

pkg/cmds/debug/gateway/config_dump.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ func (g *gatewayOpts) forwardToPort(podMeta metav1.ObjectMeta, resource string,
7878
Namespace: podMeta.Namespace,
7979
Name: podMeta.Name,
8080
Remote: *port,
81-
})
81+
},
82+
)
8283
if err := tunnel.ForwardPort(); err != nil {
8384
return nil, err
8485
}

0 commit comments

Comments
 (0)