From c9abf09136a885faa61f5729ae09ffe17d03769b Mon Sep 17 00:00:00 2001
From: 10177505
Date: Sat, 7 Nov 2020 10:37:21 +0800
Subject: [PATCH] Remove the redundant define name
---
pkg/controller/cronjob/cronjob_controller_test.go | 3 +++
1 file changed, 3 insertions(+)
diff --git a/pkg/controller/cronjob/cronjob_controller_test.go b/pkg/controller/cronjob/cronjob_controller_test.go
index 66467ce71e1..7f2133bd80b 100644
--- a/pkg/controller/cronjob/cronjob_controller_test.go
+++ b/pkg/controller/cronjob/cronjob_controller_test.go
@@ -250,6 +250,7 @@ func TestSyncOne_RunOrNot(t *testing.T) {
"prev ran but done, long overdue, past short deadline, F": {f, F, onTheHour, shortDead, T, F, weekAfterTheHour(), T, F, 1, 0},
}
for name, tc := range testCases {
+ // Don't delete the redundant define 'name' and 'tc', keep those lines for goroutines.
name := name
tc := tc
t.Run(name, func(t *testing.T) {
@@ -490,6 +491,7 @@ func TestCleanupFinishedJobs_DeleteOrNot(t *testing.T) {
}
for name, tc := range testCases {
+ // Don't delete the redundant define 'name' and 'tc', keep those lines for goroutines.
name := name
tc := tc
t.Run(name, func(t *testing.T) {
@@ -677,6 +679,7 @@ func TestSyncOne_Status(t *testing.T) {
}
for name, tc := range testCases {
+ // Don't delete the redundant define 'name' and 'tc', keep those lines for goroutines.
name := name
tc := tc
t.Run(name, func(t *testing.T) {