Skip to content

Commit d9ff6de

Browse files
authored
chore: Update golangci-lint linters and apply fixes (#477)
* chore: Update golangci-lint linters and apply fixes * Update .golangci.yml
1 parent 6ebe79b commit d9ff6de

File tree

76 files changed

+3
-456
lines changed

Some content is hidden

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

76 files changed

+3
-456
lines changed

.github/CONTRIBUTING.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,6 @@ func TestExample(t *testing.T) {
305305
},
306306
}
307307
for name, testCase := range testCases {
308-
// Do not omit this next line
309-
name, testCase := name, testCase
310308
t.Run(name, func(t *testing.T) {
311309
t.Parallel()
312310
// Implement test referencing testCase fields

.golangci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
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
@@ -19,7 +19,7 @@ linters:
1919
- paralleltest
2020
- predeclared
2121
- staticcheck
22-
- tenv
2322
- unconvert
2423
- unparam
2524
- unused
25+
- usetesting

internal/logging/provider_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ func TestProviderLoggerName(t *testing.T) {
2727
}
2828

2929
for name, testCase := range testCases {
30-
testCase := testCase
31-
3230
t.Run(name, func(t *testing.T) {
3331
t.Parallel()
3432

tfprotov5/dynamic_value_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ func TestDynamicValueIsNull(t *testing.T) {
6666
}
6767

6868
for name, testCase := range testCases {
69-
name, testCase := name, testCase
70-
7169
t.Run(name, func(t *testing.T) {
7270
t.Parallel()
7371

tfprotov5/internal/diag/diagnostics_test.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,6 @@ func TestDiagnosticsErrorCount(t *testing.T) {
145145
}
146146

147147
for name, testCase := range testCases {
148-
name, testCase := name, testCase
149-
150148
t.Run(name, func(t *testing.T) {
151149
t.Parallel()
152150

@@ -435,8 +433,6 @@ func TestDiagnosticsLog(t *testing.T) {
435433
}
436434

437435
for name, testCase := range testCases {
438-
name, testCase := name, testCase
439-
440436
t.Run(name, func(t *testing.T) {
441437
t.Parallel()
442438

@@ -588,8 +584,6 @@ func TestDiagnosticsWarningCount(t *testing.T) {
588584
}
589585

590586
for name, testCase := range testCases {
591-
name, testCase := name, testCase
592-
593587
t.Run(name, func(t *testing.T) {
594588
t.Parallel()
595589

tfprotov5/internal/fromproto/client_capabilities_test.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ func TestValidateResourceTypeConfigClientCapabilities(t *testing.T) {
3939
}
4040

4141
for name, testCase := range testCases {
42-
name, testCase := name, testCase
43-
4442
t.Run(name, func(t *testing.T) {
4543
t.Parallel()
4644

@@ -79,8 +77,6 @@ func TestConfigureProviderClientCapabilities(t *testing.T) {
7977
}
8078

8179
for name, testCase := range testCases {
82-
name, testCase := name, testCase
83-
8480
t.Run(name, func(t *testing.T) {
8581
t.Parallel()
8682

@@ -119,8 +115,6 @@ func TestReadDataSourceClientCapabilities(t *testing.T) {
119115
}
120116

121117
for name, testCase := range testCases {
122-
name, testCase := name, testCase
123-
124118
t.Run(name, func(t *testing.T) {
125119
t.Parallel()
126120

@@ -159,8 +153,6 @@ func TestReadResourceClientCapabilities(t *testing.T) {
159153
}
160154

161155
for name, testCase := range testCases {
162-
name, testCase := name, testCase
163-
164156
t.Run(name, func(t *testing.T) {
165157
t.Parallel()
166158

@@ -199,8 +191,6 @@ func TestPlanResourceChangeClientCapabilities(t *testing.T) {
199191
}
200192

201193
for name, testCase := range testCases {
202-
name, testCase := name, testCase
203-
204194
t.Run(name, func(t *testing.T) {
205195
t.Parallel()
206196

@@ -239,8 +229,6 @@ func TestImportResourceStateClientCapabilities(t *testing.T) {
239229
}
240230

241231
for name, testCase := range testCases {
242-
name, testCase := name, testCase
243-
244232
t.Run(name, func(t *testing.T) {
245233
t.Parallel()
246234

@@ -279,8 +267,6 @@ func TestOpenEphemeralResourceClientCapabilities(t *testing.T) {
279267
}
280268

281269
for name, testCase := range testCases {
282-
name, testCase := name, testCase
283-
284270
t.Run(name, func(t *testing.T) {
285271
t.Parallel()
286272

tfprotov5/internal/fromproto/data_source_test.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ func TestReadDataSourceRequest(t *testing.T) {
6666
}
6767

6868
for name, testCase := range testCases {
69-
name, testCase := name, testCase
70-
7169
t.Run(name, func(t *testing.T) {
7270
t.Parallel()
7371

@@ -114,8 +112,6 @@ func TestValidateDataSourceConfigRequest(t *testing.T) {
114112
}
115113

116114
for name, testCase := range testCases {
117-
name, testCase := name, testCase
118-
119115
t.Run(name, func(t *testing.T) {
120116
t.Parallel()
121117

tfprotov5/internal/fromproto/ephemeral_resource_test.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ func TestValidateEphemeralResourceConfigRequest(t *testing.T) {
4747
}
4848

4949
for name, testCase := range testCases {
50-
name, testCase := name, testCase
51-
5250
t.Run(name, func(t *testing.T) {
5351
t.Parallel()
5452

@@ -107,8 +105,6 @@ func TestOpenEphemeralResourceRequest(t *testing.T) {
107105
}
108106

109107
for name, testCase := range testCases {
110-
name, testCase := name, testCase
111-
112108
t.Run(name, func(t *testing.T) {
113109
t.Parallel()
114110

@@ -155,8 +151,6 @@ func TestRenewEphemeralResourceRequest(t *testing.T) {
155151
}
156152

157153
for name, testCase := range testCases {
158-
name, testCase := name, testCase
159-
160154
t.Run(name, func(t *testing.T) {
161155
t.Parallel()
162156

@@ -203,8 +197,6 @@ func TestCloseEphemeralResourceRequest(t *testing.T) {
203197
}
204198

205199
for name, testCase := range testCases {
206-
name, testCase := name, testCase
207-
208200
t.Run(name, func(t *testing.T) {
209201
t.Parallel()
210202

tfprotov5/internal/fromproto/function_test.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ func TestCallFunctionRequest(t *testing.T) {
5353
}
5454

5555
for name, testCase := range testCases {
56-
name, testCase := name, testCase
57-
5856
t.Run(name, func(t *testing.T) {
5957
t.Parallel()
6058

@@ -85,8 +83,6 @@ func TestGetFunctionsRequest(t *testing.T) {
8583
}
8684

8785
for name, testCase := range testCases {
88-
name, testCase := name, testCase
89-
9086
t.Run(name, func(t *testing.T) {
9187
t.Parallel()
9288

tfprotov5/internal/fromproto/provider_test.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ func TestGetMetadataRequest(t *testing.T) {
3030
}
3131

3232
for name, testCase := range testCases {
33-
name, testCase := name, testCase
34-
3533
t.Run(name, func(t *testing.T) {
3634
t.Parallel()
3735

@@ -62,8 +60,6 @@ func TestGetProviderSchemaRequest(t *testing.T) {
6260
}
6361

6462
for name, testCase := range testCases {
65-
name, testCase := name, testCase
66-
6763
t.Run(name, func(t *testing.T) {
6864
t.Parallel()
6965

@@ -94,8 +90,6 @@ func TestGetResourceIdentitySchemasRequest(t *testing.T) {
9490
}
9591

9692
for name, testCase := range testCases {
97-
name, testCase := name, testCase
98-
9993
t.Run(name, func(t *testing.T) {
10094
t.Parallel()
10195

@@ -154,8 +148,6 @@ func TestConfigureProviderRequest(t *testing.T) {
154148
}
155149

156150
for name, testCase := range testCases {
157-
name, testCase := name, testCase
158-
159151
t.Run(name, func(t *testing.T) {
160152
t.Parallel()
161153

@@ -194,8 +186,6 @@ func TestPrepareProviderConfigRequest(t *testing.T) {
194186
}
195187

196188
for name, testCase := range testCases {
197-
name, testCase := name, testCase
198-
199189
t.Run(name, func(t *testing.T) {
200190
t.Parallel()
201191

@@ -226,8 +216,6 @@ func TestStopProviderRequest(t *testing.T) {
226216
}
227217

228218
for name, testCase := range testCases {
229-
name, testCase := name, testCase
230-
231219
t.Run(name, func(t *testing.T) {
232220
t.Parallel()
233221

0 commit comments

Comments
 (0)