Skip to content

Commit

Permalink
fix: fix a shadowing setting in .golangci.yml (#5654)
Browse files Browse the repository at this point in the history
  • Loading branch information
massongit committed May 16, 2024
1 parent 56576d4 commit 03b4aa0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 43 deletions.
41 changes: 0 additions & 41 deletions .github/linters/.golangci.yml

This file was deleted.

5 changes: 3 additions & 2 deletions TEMPLATES/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ linters-settings:
# default is false: such cases aren't reported by default.
check-blank: true
govet:
# report about shadowed variables
check-shadowing: true
enable:
# report about shadowed variables
- shadowing
gocyclo:
# minimal code complexity to report, 30 by default
min-complexity: 15
Expand Down
8 changes: 8 additions & 0 deletions test/linters/go_modules/go_modules_bad/golang_bad_01.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,11 @@ import (
if len(in) == 0 {
return "", fmt.Errorf("Input is empty")
}

x := 0
{
var x int
x++
}

fmt.Println(x)

0 comments on commit 03b4aa0

Please sign in to comment.