Open
Description
If we enable variable shadowing check in govet, we get a lot of errors. Variable shadowing can cause hard to debug issues.
diff --git a/.golangci.yaml b/.golangci.yaml
index a1014da..e9b2a0c 100644
--- a/.golangci.yaml
+++ b/.golangci.yaml
@@ -110,6 +110,9 @@ linters-settings:
gocritic:
enabled-tags:
- experimental
+ govet:
+ enable:
+ - shadow
issues:
exclude-files:
- "zz_generated.*\\.go$"
leads to
internal/controller/ironic_controller.go:129:19: shadow: declaration of "err" shadows declaration at line 107 (govet)
parsedVersion, err := metal3api.ParseVersion(ironicConf.Status.InstalledVersion)
^
pkg/ironic/ironic.go:172:14: shadow: declaration of "err" shadows declaration at line 159 (govet)
jobStatus, err := ensureIronicUpgradeJob(cctx, resources, preUpgrade)
^
INFO File cache stats: 2 entries of total size 16.8KiB
INFO Memory: 577 samples, avg is 839.2MB, max is 4952.4MB
INFO Execution took 58.153887653s
make: *** [Makefile:243: lint] Error 1
/kind ci
/help
/good-first-issue