Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment on lines +22 to +26
Copy link
Contributor Author

@kyu08 kyu08 May 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If check-alias is false, an assignment to a variable with another name will not be detected an error.

for _, x := range someSlice {
    a := x
}

I think check-alias should be true.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree.

exhaustive:
default-signifies-exhaustive: true
staticcheck:
Expand Down