Skip to content

Commit 12f2c2d

Browse files
committed
Modernize for loops
1 parent 1e69bc0 commit 12f2c2d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pkg/controller/controller.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,15 +293,15 @@ func (ctrl *resizeController) Run(workers int, ctx context.Context, wg *sync.Wai
293293
}
294294

295295
if utilfeature.DefaultFeatureGate.Enabled(features.ReleaseLeaderElectionOnExit) {
296-
for i := 0; i < workers; i++ {
296+
for range workers {
297297
wg.Add(1)
298298
go func() {
299299
defer wg.Done()
300300
wait.Until(ctrl.syncPVCs, 0, stopCh)
301301
}()
302302
}
303303
} else {
304-
for i := 0; i < workers; i++ {
304+
for range workers {
305305
go wait.Until(ctrl.syncPVCs, 0, stopCh)
306306
}
307307
}

pkg/modifycontroller/controller.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,15 +224,15 @@ func (ctrl *modifyController) Run(
224224
go ctrl.slowSet.Run(stopCh)
225225

226226
if utilfeature.DefaultFeatureGate.Enabled(features.ReleaseLeaderElectionOnExit) {
227-
for i := 0; i < workers; i++ {
227+
for range workers {
228228
wg.Add(1)
229229
go func() {
230230
defer wg.Done()
231231
wait.Until(ctrl.sync, 0, stopCh)
232232
}()
233233
}
234234
} else {
235-
for i := 0; i < workers; i++ {
235+
for range workers {
236236
go wait.Until(ctrl.sync, 0, stopCh)
237237
}
238238
}

0 commit comments

Comments
 (0)