Skip to content

Commit f42bea3

Browse files
authored
ci: Fix go lint config (#1599)
This fixes the configuration to enable the go vet shadowing checks. It deliberately ignores the shadowing of err or ctx variables given this is a pattern that is widely used in Go code. Signed-off-by: Dave Tucker <[email protected]>
1 parent 10e5f1c commit f42bea3

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

.golangci.yml

+5-6
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ linters-settings:
1919
local-prefixes: github.com/golangci/golangci-lint
2020

2121
govet:
22-
shadow: true
22+
enable:
23+
- shadow
2324
settings:
2425
printf:
2526
funcs:
@@ -86,9 +87,7 @@ run:
8687

8788
issues:
8889
exclude-rules:
89-
- linters:
90-
- typecheck
91-
text: could not import C
92-
- linters:
93-
- dupl
90+
- linters: [dupl]
9491
text: .*pkg/collector/stats/types/types_test.go.* # false positive, https://github.com/mibk/dupl/issues/20
92+
- text: 'shadow: declaration of "(err|ctx)" shadows declaration at' # yamllint disable-line rule:quoted-strings
93+
linters: [govet]

0 commit comments

Comments
 (0)