Skip to content

Commit 549e12c

Browse files
committed
🚑 Don't closure over the loop variable.
1 parent b872365 commit 549e12c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎utils/utils.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ func ListMatchingMigrators(ctx context.Context, c client.Client, pod metav1.Obje
4343
continue
4444
}
4545
if selector.Matches(podLabels) {
46-
migrators = append(migrators, &m)
46+
migrator := m
47+
migrators = append(migrators, &migrator)
4748
}
4849
}
4950
return migrators, nil

0 commit comments

Comments
 (0)