@@ -10,7 +10,7 @@ import (
10
10
"github.com/stretchr/testify/require"
11
11
)
12
12
13
- func Test_testRequest (t * testing.T ) {
13
+ func Test_testRequest (t * testing.T ) { //nolint:funlen
14
14
data := []struct {
15
15
title string
16
16
req * http.Request
@@ -107,6 +107,7 @@ func Test_testRequest(t *testing.T) {
107
107
}
108
108
109
109
for _ , d := range data {
110
+ d := d
110
111
t .Run (d .title , func (t * testing.T ) {
111
112
testRequest (t , d .req , d .service , d .route )
112
113
})
@@ -133,6 +134,7 @@ request name: create a user`,
133
134
}
134
135
135
136
for _ , d := range data {
137
+ d := d
136
138
t .Run (d .title , func (t * testing.T ) {
137
139
require .Equal (t , d .exp , makeMsg (d .msg , d .srv , d .reqName ))
138
140
})
@@ -171,6 +173,7 @@ func Test_testBodyString(t *testing.T) {
171
173
}
172
174
173
175
for _ , d := range data {
176
+ d := d
174
177
t .Run (d .title , func (t * testing.T ) {
175
178
testBodyString (t , d .req , d .service , d .route )
176
179
})
@@ -201,6 +204,7 @@ func Test_testPath(t *testing.T) {
201
204
}
202
205
203
206
for _ , d := range data {
207
+ d := d
204
208
t .Run (d .title , func (t * testing.T ) {
205
209
testPath (t , d .req , d .service , d .route )
206
210
})
@@ -229,6 +233,7 @@ func Test_testMethod(t *testing.T) {
229
233
}
230
234
231
235
for _ , d := range data {
236
+ d := d
232
237
t .Run (d .title , func (t * testing.T ) {
233
238
testMethod (t , d .req , d .service , d .route )
234
239
})
@@ -269,6 +274,7 @@ func Test_testBodyJSON(t *testing.T) {
269
274
}
270
275
271
276
for _ , d := range data {
277
+ d := d
272
278
t .Run (d .title , func (t * testing.T ) {
273
279
testBodyJSON (t , d .req , d .service , d .route )
274
280
})
@@ -307,6 +313,7 @@ func Test_testBodyJSONString(t *testing.T) {
307
313
}
308
314
309
315
for _ , d := range data {
316
+ d := d
310
317
t .Run (d .title , func (t * testing.T ) {
311
318
testBodyJSONString (t , d .req , d .service , d .route )
312
319
})
@@ -341,6 +348,7 @@ func Test_testPartOfHeader(t *testing.T) {
341
348
}
342
349
343
350
for _ , d := range data {
351
+ d := d
344
352
t .Run (d .title , func (t * testing.T ) {
345
353
testPartOfHeader (t , d .req , d .service , d .route )
346
354
})
@@ -373,6 +381,7 @@ func Test_testPartOfQuery(t *testing.T) {
373
381
}
374
382
375
383
for _ , d := range data {
384
+ d := d
376
385
t .Run (d .title , func (t * testing.T ) {
377
386
testPartOfQuery (t , d .req , d .service , d .route )
378
387
})
0 commit comments