Skip to content

Commit b138247

Browse files
committed
[golangci-lint] for loop can be changed to use an integer range
1 parent 8c9dcff commit b138247

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

internal/controller/eviction_controller_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ var _ = Describe("Eviction Controller", func() {
225225
})
226226

227227
It("should fail reconciliation", func() {
228-
for i := 0; i < 3; i++ {
228+
for range 3 {
229229
_, err := controllerReconciler.Reconcile(ctx, reconcileRequest)
230230
Expect(err).NotTo(HaveOccurred())
231231
}
@@ -363,7 +363,7 @@ var _ = Describe("Eviction Controller", func() {
363363
Expect(ctrlRuntimeClient.IgnoreAlreadyExists(k8sClient.Create(ctx, hypervisor))).To(Succeed())
364364
})
365365
It("should succeed the reconciliation", func() {
366-
for i := 0; i < 3; i++ {
366+
for range 3 {
367367
_, err := controllerReconciler.Reconcile(ctx, reconcileRequest)
368368
Expect(err).NotTo(HaveOccurred())
369369
}

internal/controller/hypervisor_controller_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ var _ = Describe("Hypervisor Controller", func() {
123123
Expect(k8sClient.Status().Update(ctx, resource)).To(Succeed())
124124

125125
By("Reconciling the created resource")
126-
for i := 0; i < 3; i++ {
126+
for range 3 {
127127
_, err := hypervisorController.Reconcile(ctx, ctrl.Request{
128128
NamespacedName: types.NamespacedName{Name: resource.Name},
129129
})

0 commit comments

Comments
 (0)