Add copyloopvar to enabled linters (#3586)

Resolves #3573 
It looks like the update to go1.22 is done by
https://github.com/jesseduffield/lazygit/pull/3574. So it should be OK
to close #3573 when this PR is merged.

## PR Description
Add [`copyloopvar`](https://github.com/karamaru-alpha/copyloopvar) to
enabled linters to detect unnecessary assignments in `for` loops.

## Context
@jesseduffield and I were talking about necessity of this linter here.
https://github.com/jesseduffield/lazygit/issues/3573#issuecomment-2123732829
This commit is contained in:
Stefan Haller 2024-05-24 11:03:01 +02:00 committed by GitHub
commit ce3fe37787
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -14,10 +14,16 @@ linters:
- exhaustive
- makezero
- nakedret
- copyloopvar
# - goconst # TODO: enable and fix issues
fast: false
linters-settings:
copyloopvar:
# Check all assigning the loop variable to another variable.
# Default: false
# If true, an assignment like `a := x` will be detected as an error.
check-alias: true
exhaustive:
default-signifies-exhaustive: true
staticcheck: