Skip to content

Commit bd98231

Browse files
authored
refactor: remove unneeded loop copies (#295)
1 parent 29ad096 commit bd98231

File tree

12 files changed

+0
-31
lines changed

12 files changed

+0
-31
lines changed

.golangci.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ linters:
2424
- varnamelen # maybe later
2525
- wsl # disagree with, for now
2626
- intrange
27-
- copyloopvar
2827
- predeclared
2928
- govet
3029

internal/configer/update_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,6 @@ func TestUpdateWithIgnores(t *testing.T) {
195195
},
196196
}
197197
for _, tt := range tests {
198-
tt := tt
199198
t.Run(tt.name, func(t *testing.T) {
200199
t.Parallel()
201200

internal/reporter/report_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ func TestReport_HasKnownVulnerabilities(t *testing.T) {
8585
},
8686
}
8787
for _, tt := range tests {
88-
tt := tt
8988
t.Run(tt.name, func(t *testing.T) {
9089
t.Parallel()
9190
r := reporter.Report{
@@ -223,7 +222,6 @@ func TestReport_HasIgnoredVulnerabilities(t *testing.T) {
223222
},
224223
}
225224
for _, tt := range tests {
226-
tt := tt
227225
t.Run(tt.name, func(t *testing.T) {
228226
t.Parallel()
229227
r := reporter.Report{

internal/reporter/reporter_test.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ func TestReporter_PrintText(t *testing.T) {
170170
},
171171
}
172172
for _, tt := range tests {
173-
tt := tt
174173
t.Run(tt.name, func(t *testing.T) {
175174
t.Parallel()
176175

@@ -242,7 +241,6 @@ func TestReporter_PrintDatabaseLoadErr(t *testing.T) {
242241
},
243242
}
244243
for _, tt := range tests {
245-
tt := tt
246244
t.Run(tt.name, func(t *testing.T) {
247245
t.Parallel()
248246

@@ -309,7 +307,6 @@ func TestReporter_PrintKnownEcosystems(t *testing.T) {
309307
},
310308
}
311309
for _, tt := range tests {
312-
tt := tt
313310
t.Run(tt.name, func(t *testing.T) {
314311
t.Parallel()
315312

main_test.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,6 @@ func TestRun(t *testing.T) {
193193
},
194194
}
195195
for _, tt := range tests {
196-
tt := tt
197196
t.Run(tt.name, func(t *testing.T) {
198197
t.Parallel()
199198

@@ -298,7 +297,6 @@ func TestRun_EmptyDirExitCode(t *testing.T) {
298297
},
299298
}
300299
for _, tt := range tests {
301-
tt := tt
302300
t.Run(tt.name, func(t *testing.T) {
303301
t.Parallel()
304302

@@ -362,7 +360,6 @@ func TestRun_ListPackages(t *testing.T) {
362360
},
363361
}
364362
for _, tt := range tests {
365-
tt := tt
366363
t.Run(tt.name, func(t *testing.T) {
367364
t.Parallel()
368365

@@ -476,7 +473,6 @@ func TestRun_Lockfile(t *testing.T) {
476473
},
477474
}
478475
for _, tt := range tests {
479-
tt := tt
480476
t.Run(tt.name, func(t *testing.T) {
481477
t.Parallel()
482478

@@ -521,7 +517,6 @@ func TestRun_DBs(t *testing.T) {
521517
},
522518
}
523519
for _, tt := range tests {
524-
tt := tt
525520
t.Run(tt.name, func(t *testing.T) {
526521
t.Parallel()
527522

@@ -654,7 +649,6 @@ func TestRun_ParseAsSpecific(t *testing.T) {
654649
},
655650
}
656651
for _, tt := range tests {
657-
tt := tt
658652
t.Run(tt.name, func(t *testing.T) {
659653
t.Parallel()
660654

@@ -797,7 +791,6 @@ func TestRun_ParseAsGlobal(t *testing.T) {
797791
},
798792
}
799793
for _, tt := range tests {
800-
tt := tt
801794
t.Run(tt.name, func(t *testing.T) {
802795
t.Parallel()
803796

@@ -878,7 +871,6 @@ func TestRun_ParseAs_CsvRow(t *testing.T) {
878871
},
879872
}
880873
for _, tt := range tests {
881-
tt := tt
882874
t.Run(tt.name, func(t *testing.T) {
883875
t.Parallel()
884876

@@ -924,7 +916,6 @@ func TestRun_ParseAs_CsvFile(t *testing.T) {
924916
},
925917
}
926918
for _, tt := range tests {
927-
tt := tt
928919
t.Run(tt.name, func(t *testing.T) {
929920
t.Parallel()
930921

@@ -1207,7 +1198,6 @@ func TestRun_Configs(t *testing.T) {
12071198
},
12081199
}
12091200
for _, tt := range tests {
1210-
tt := tt
12111201
t.Run(tt.name, func(t *testing.T) {
12121202
t.Parallel()
12131203

@@ -1371,7 +1361,6 @@ func TestRun_Ignores(t *testing.T) {
13711361
},
13721362
}
13731363
for _, tt := range tests {
1374-
tt := tt
13751364
t.Run(tt.name, func(t *testing.T) {
13761365
t.Parallel()
13771366

@@ -1737,7 +1726,6 @@ func TestRun_UpdatingConfigIgnores(t *testing.T) {
17371726
},
17381727
}
17391728
for _, tt := range tests {
1740-
tt := tt
17411729
t.Run(tt.name, func(t *testing.T) {
17421730
t.Parallel()
17431731

@@ -1809,7 +1797,6 @@ func TestRun_EndToEnd(t *testing.T) {
18091797
}
18101798

18111799
for _, tt := range tests {
1812-
tt := tt
18131800
t.Run(tt.name, func(t *testing.T) {
18141801
t.Parallel()
18151802

pkg/database/api_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ func TestNewAPIDB(t *testing.T) {
4646
},
4747
}
4848
for _, tt := range tests {
49-
tt := tt
5049
t.Run(tt.name, func(t *testing.T) {
5150
t.Parallel()
5251

pkg/database/osv_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -995,7 +995,6 @@ func TestVersions_MarshalJSON(t *testing.T) {
995995
}
996996

997997
for _, tt := range tests {
998-
tt := tt
999998
t.Run(tt.name, func(t *testing.T) {
1000999
t.Parallel()
10011000
got, err := tt.vs.MarshalJSON()

pkg/database/vulnerabilities_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ func TestVulnerabilities_Includes(t *testing.T) {
117117
},
118118
}
119119
for _, tt := range tests {
120-
tt := tt
121120
t.Run(tt.name, func(t *testing.T) {
122121
t.Parallel()
123122

@@ -166,7 +165,6 @@ func TestVulnerabilities_MarshalJSON(t *testing.T) {
166165
}
167166

168167
for _, tt := range tests {
169-
tt := tt
170168
t.Run(tt.name, func(t *testing.T) {
171169
t.Parallel()
172170
got, err := tt.vs.MarshalJSON()

pkg/lockfile/csv_test.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ func TestFromCSVRows(t *testing.T) {
140140
}
141141

142142
for _, tt := range tests {
143-
tt := tt
144143
t.Run(tt.name, func(t *testing.T) {
145144
t.Parallel()
146145

@@ -242,7 +241,6 @@ func TestFromCSVRows_Errors(t *testing.T) {
242241
}
243242

244243
for _, tt := range tests {
245-
tt := tt
246244
t.Run(tt.name, func(t *testing.T) {
247245
t.Parallel()
248246

@@ -482,7 +480,6 @@ func TestFromCSVFile(t *testing.T) {
482480
}
483481

484482
for _, tt := range tests {
485-
tt := tt
486483
t.Run(tt.name, func(t *testing.T) {
487484
t.Parallel()
488485

@@ -533,7 +530,6 @@ func TestFromCSVFile_Errors(t *testing.T) {
533530
}
534531

535532
for _, tt := range tests {
536-
tt := tt
537533
t.Run(tt.name, func(t *testing.T) {
538534
t.Parallel()
539535

pkg/lockfile/parse-maven-lock_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,6 @@ func TestMavenLockDependency_ResolveVersion(t *testing.T) {
230230
},
231231
}
232232
for _, tt := range tests {
233-
tt := tt
234233
t.Run(tt.name, func(t *testing.T) {
235234
t.Parallel()
236235

0 commit comments

Comments
 (0)