Skip to content

Commit fbfbe5c

Browse files
authored
chore: Update golangci-lint linters and apply fixes (#1091)
1 parent bf1d023 commit fbfbe5c

File tree

477 files changed

+4
-3816
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

477 files changed

+4
-3816
lines changed

.golangci.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
issues:
2-
max-per-linter: 0
2+
max-issues-per-linter: 0
33
max-same-issues: 0
44

55
linters:
66
disable-all: true
77
enable:
8+
- copyloopvar
89
- durationcheck
910
- errcheck
10-
- exportloopref
1111
- forcetypeassert
1212
- gofmt
1313
- gosimple
14+
- govet
1415
- ineffassign
1516
- makezero
1617
- misspell
1718
- nilerr
1819
- paralleltest
1920
- predeclared
2021
- staticcheck
21-
- tenv
2222
- unconvert
2323
- unparam
2424
- unused
25-
- govet
25+
- usetesting
2626

2727
run:
2828
# Prevent false positive timeouts in CI

datasource/schema/bool_attribute_test.go

-24
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ func TestBoolAttributeApplyTerraform5AttributePathStep(t *testing.T) {
5656
}
5757

5858
for name, testCase := range testCases {
59-
name, testCase := name, testCase
60-
6159
t.Run(name, func(t *testing.T) {
6260
t.Parallel()
6361

@@ -104,8 +102,6 @@ func TestBoolAttributeBoolValidators(t *testing.T) {
104102
}
105103

106104
for name, testCase := range testCases {
107-
name, testCase := name, testCase
108-
109105
t.Run(name, func(t *testing.T) {
110106
t.Parallel()
111107

@@ -138,8 +134,6 @@ func TestBoolAttributeGetDeprecationMessage(t *testing.T) {
138134
}
139135

140136
for name, testCase := range testCases {
141-
name, testCase := name, testCase
142-
143137
t.Run(name, func(t *testing.T) {
144138
t.Parallel()
145139

@@ -173,8 +167,6 @@ func TestBoolAttributeEqual(t *testing.T) {
173167
}
174168

175169
for name, testCase := range testCases {
176-
name, testCase := name, testCase
177-
178170
t.Run(name, func(t *testing.T) {
179171
t.Parallel()
180172

@@ -207,8 +199,6 @@ func TestBoolAttributeGetDescription(t *testing.T) {
207199
}
208200

209201
for name, testCase := range testCases {
210-
name, testCase := name, testCase
211-
212202
t.Run(name, func(t *testing.T) {
213203
t.Parallel()
214204

@@ -241,8 +231,6 @@ func TestBoolAttributeGetMarkdownDescription(t *testing.T) {
241231
}
242232

243233
for name, testCase := range testCases {
244-
name, testCase := name, testCase
245-
246234
t.Run(name, func(t *testing.T) {
247235
t.Parallel()
248236

@@ -275,8 +263,6 @@ func TestBoolAttributeGetType(t *testing.T) {
275263
}
276264

277265
for name, testCase := range testCases {
278-
name, testCase := name, testCase
279-
280266
t.Run(name, func(t *testing.T) {
281267
t.Parallel()
282268

@@ -309,8 +295,6 @@ func TestBoolAttributeIsComputed(t *testing.T) {
309295
}
310296

311297
for name, testCase := range testCases {
312-
name, testCase := name, testCase
313-
314298
t.Run(name, func(t *testing.T) {
315299
t.Parallel()
316300

@@ -343,8 +327,6 @@ func TestBoolAttributeIsOptional(t *testing.T) {
343327
}
344328

345329
for name, testCase := range testCases {
346-
name, testCase := name, testCase
347-
348330
t.Run(name, func(t *testing.T) {
349331
t.Parallel()
350332

@@ -377,8 +359,6 @@ func TestBoolAttributeIsRequired(t *testing.T) {
377359
}
378360

379361
for name, testCase := range testCases {
380-
name, testCase := name, testCase
381-
382362
t.Run(name, func(t *testing.T) {
383363
t.Parallel()
384364

@@ -411,8 +391,6 @@ func TestBoolAttributeIsSensitive(t *testing.T) {
411391
}
412392

413393
for name, testCase := range testCases {
414-
name, testCase := name, testCase
415-
416394
t.Run(name, func(t *testing.T) {
417395
t.Parallel()
418396

@@ -439,8 +417,6 @@ func TestBoolAttributeIsWriteOnly(t *testing.T) {
439417
}
440418

441419
for name, testCase := range testCases {
442-
name, testCase := name, testCase
443-
444420
t.Run(name, func(t *testing.T) {
445421
t.Parallel()
446422

datasource/schema/dynamic_attribute_test.go

-24
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ func TestDynamicAttributeApplyTerraform5AttributePathStep(t *testing.T) {
5656
}
5757

5858
for name, testCase := range testCases {
59-
name, testCase := name, testCase
60-
6159
t.Run(name, func(t *testing.T) {
6260
t.Parallel()
6361

@@ -104,8 +102,6 @@ func TestDynamicAttributeGetDeprecationMessage(t *testing.T) {
104102
}
105103

106104
for name, testCase := range testCases {
107-
name, testCase := name, testCase
108-
109105
t.Run(name, func(t *testing.T) {
110106
t.Parallel()
111107

@@ -139,8 +135,6 @@ func TestDynamicAttributeEqual(t *testing.T) {
139135
}
140136

141137
for name, testCase := range testCases {
142-
name, testCase := name, testCase
143-
144138
t.Run(name, func(t *testing.T) {
145139
t.Parallel()
146140

@@ -173,8 +167,6 @@ func TestDynamicAttributeGetDescription(t *testing.T) {
173167
}
174168

175169
for name, testCase := range testCases {
176-
name, testCase := name, testCase
177-
178170
t.Run(name, func(t *testing.T) {
179171
t.Parallel()
180172

@@ -207,8 +199,6 @@ func TestDynamicAttributeGetMarkdownDescription(t *testing.T) {
207199
}
208200

209201
for name, testCase := range testCases {
210-
name, testCase := name, testCase
211-
212202
t.Run(name, func(t *testing.T) {
213203
t.Parallel()
214204

@@ -241,8 +231,6 @@ func TestDynamicAttributeGetType(t *testing.T) {
241231
}
242232

243233
for name, testCase := range testCases {
244-
name, testCase := name, testCase
245-
246234
t.Run(name, func(t *testing.T) {
247235
t.Parallel()
248236

@@ -275,8 +263,6 @@ func TestDynamicAttributeIsComputed(t *testing.T) {
275263
}
276264

277265
for name, testCase := range testCases {
278-
name, testCase := name, testCase
279-
280266
t.Run(name, func(t *testing.T) {
281267
t.Parallel()
282268

@@ -309,8 +295,6 @@ func TestDynamicAttributeIsOptional(t *testing.T) {
309295
}
310296

311297
for name, testCase := range testCases {
312-
name, testCase := name, testCase
313-
314298
t.Run(name, func(t *testing.T) {
315299
t.Parallel()
316300

@@ -343,8 +327,6 @@ func TestDynamicAttributeIsRequired(t *testing.T) {
343327
}
344328

345329
for name, testCase := range testCases {
346-
name, testCase := name, testCase
347-
348330
t.Run(name, func(t *testing.T) {
349331
t.Parallel()
350332

@@ -377,8 +359,6 @@ func TestDynamicAttributeIsSensitive(t *testing.T) {
377359
}
378360

379361
for name, testCase := range testCases {
380-
name, testCase := name, testCase
381-
382362
t.Run(name, func(t *testing.T) {
383363
t.Parallel()
384364

@@ -405,8 +385,6 @@ func TestDynamicAttributeIsWriteOnly(t *testing.T) {
405385
}
406386

407387
for name, testCase := range testCases {
408-
name, testCase := name, testCase
409-
410388
t.Run(name, func(t *testing.T) {
411389
t.Parallel()
412390

@@ -439,8 +417,6 @@ func TestDynamicAttributeDynamicValidators(t *testing.T) {
439417
}
440418

441419
for name, testCase := range testCases {
442-
name, testCase := name, testCase
443-
444420
t.Run(name, func(t *testing.T) {
445421
t.Parallel()
446422

datasource/schema/float32_attribute_test.go

-24
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ func TestFloat32AttributeApplyTerraform5AttributePathStep(t *testing.T) {
5656
}
5757

5858
for name, testCase := range testCases {
59-
name, testCase := name, testCase
60-
6159
t.Run(name, func(t *testing.T) {
6260
t.Parallel()
6361

@@ -104,8 +102,6 @@ func TestFloat32AttributeFloat32Validators(t *testing.T) {
104102
}
105103

106104
for name, testCase := range testCases {
107-
name, testCase := name, testCase
108-
109105
t.Run(name, func(t *testing.T) {
110106
t.Parallel()
111107

@@ -138,8 +134,6 @@ func TestFloat32AttributeGetDeprecationMessage(t *testing.T) {
138134
}
139135

140136
for name, testCase := range testCases {
141-
name, testCase := name, testCase
142-
143137
t.Run(name, func(t *testing.T) {
144138
t.Parallel()
145139

@@ -173,8 +167,6 @@ func TestFloat32AttributeEqual(t *testing.T) {
173167
}
174168

175169
for name, testCase := range testCases {
176-
name, testCase := name, testCase
177-
178170
t.Run(name, func(t *testing.T) {
179171
t.Parallel()
180172

@@ -207,8 +199,6 @@ func TestFloat32AttributeGetDescription(t *testing.T) {
207199
}
208200

209201
for name, testCase := range testCases {
210-
name, testCase := name, testCase
211-
212202
t.Run(name, func(t *testing.T) {
213203
t.Parallel()
214204

@@ -241,8 +231,6 @@ func TestFloat32AttributeGetMarkdownDescription(t *testing.T) {
241231
}
242232

243233
for name, testCase := range testCases {
244-
name, testCase := name, testCase
245-
246234
t.Run(name, func(t *testing.T) {
247235
t.Parallel()
248236

@@ -275,8 +263,6 @@ func TestFloat32AttributeGetType(t *testing.T) {
275263
}
276264

277265
for name, testCase := range testCases {
278-
name, testCase := name, testCase
279-
280266
t.Run(name, func(t *testing.T) {
281267
t.Parallel()
282268

@@ -309,8 +295,6 @@ func TestFloat32AttributeIsComputed(t *testing.T) {
309295
}
310296

311297
for name, testCase := range testCases {
312-
name, testCase := name, testCase
313-
314298
t.Run(name, func(t *testing.T) {
315299
t.Parallel()
316300

@@ -343,8 +327,6 @@ func TestFloat32AttributeIsOptional(t *testing.T) {
343327
}
344328

345329
for name, testCase := range testCases {
346-
name, testCase := name, testCase
347-
348330
t.Run(name, func(t *testing.T) {
349331
t.Parallel()
350332

@@ -377,8 +359,6 @@ func TestFloat32AttributeIsRequired(t *testing.T) {
377359
}
378360

379361
for name, testCase := range testCases {
380-
name, testCase := name, testCase
381-
382362
t.Run(name, func(t *testing.T) {
383363
t.Parallel()
384364

@@ -411,8 +391,6 @@ func TestFloat32AttributeIsSensitive(t *testing.T) {
411391
}
412392

413393
for name, testCase := range testCases {
414-
name, testCase := name, testCase
415-
416394
t.Run(name, func(t *testing.T) {
417395
t.Parallel()
418396

@@ -439,8 +417,6 @@ func TestFloat32AttributeIsWriteOnly(t *testing.T) {
439417
}
440418

441419
for name, testCase := range testCases {
442-
name, testCase := name, testCase
443-
444420
t.Run(name, func(t *testing.T) {
445421
t.Parallel()
446422

0 commit comments

Comments
 (0)