Skip to content

Commit afd8056

Browse files
fix linter warnings (#403)
Fixing these linter warnings: ``` WARN [config_reader] The configuration option `linters.govet.check-shadowing` is deprecated. Please enable `shadow` instead, if you are not using `enable-all`. WARN The linter 'exportloopref' is deprecated (since v1.60.2) due to: Since Go1.22 (loopvar) this linter is no longer relevant. Replaced by copyloopvar. ```
1 parent ab60004 commit afd8056

File tree

4 files changed

+1
-6
lines changed

4 files changed

+1
-6
lines changed

.golangci.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ linters:
2020
- depguard
2121
- durationcheck
2222
- errorlint
23-
- exportloopref
23+
- copyloopvar
2424
- gocritic
2525
- nakedret
2626
- stylecheck
@@ -37,7 +37,6 @@ linters-settings:
3737
errorf: false # it's valid to use %v instead of %w
3838

3939
govet:
40-
check-shadowing: true
4140
enable-all: true
4241

4342
# We have a ton of test-only packages; but make sure we keep prod deps small.

generate/imports_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ func TestMakeIdentifier(t *testing.T) {
2828
}
2929

3030
for _, test := range tests {
31-
test := test
3231
t.Run(test.testName, func(t *testing.T) {
3332
actual := makeIdentifier(test.input)
3433
if actual != test.expected {

generate/names_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ func TestTypeNames(t *testing.T) {
5656
"lower",
5757
}}
5858
for _, test := range tests {
59-
test := test
6059
t.Run(test.expectedTypeName, func(t *testing.T) {
6160
prefix := newPrefixList("Operation")
6261
for _, field := range test.fields {
@@ -105,7 +104,6 @@ func TestSnakeToTypeNames(t *testing.T) {
105104
}}
106105

107106
for _, test := range tests {
108-
test := test
109107
t.Run(test.expectedTypeName, func(t *testing.T) {
110108
prefix := newPrefixList("ServiceIPs")
111109
algorithm := CasingDefault

generate/util_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ type test struct {
1010

1111
func testStringFunc(t *testing.T, f func(string) string, tests []test) {
1212
for _, test := range tests {
13-
test := test
1413
t.Run(test.name, func(t *testing.T) {
1514
got := f(test.in)
1615
if got != test.out {

0 commit comments

Comments
 (0)