Skip to content

Commit b17289d

Browse files
authored
refactor: omit unnecessary reassignment (#5296)
Signed-off-by: zhoujiaweii <[email protected]>
1 parent 2611e7d commit b17289d

File tree

8 files changed

+0
-13
lines changed

8 files changed

+0
-13
lines changed

orderer/common/cluster/clusterservice_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -925,7 +925,6 @@ func TestClusterRequestAsString(t *testing.T) {
925925
}
926926

927927
for _, tc := range tcs {
928-
tc := tc
929928
t.Run(tc.name, func(t *testing.T) {
930929
t.Parallel()
931930
retVal := cluster.ClusterRequestAsString(tc.input)

orderer/common/cluster/comm_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,6 @@ func TestAbortRPC(t *testing.T) {
813813
}
814814

815815
for _, testCase := range testCases {
816-
testCase := testCase
817816
t.Run(testCase.name, func(t *testing.T) {
818817
testAbort(t, testCase.abortFunc, testCase.rpcTimeout, testCase.expectedErr)
819818
})
@@ -1377,7 +1376,6 @@ func TestMetrics(t *testing.T) {
13771376
},
13781377
},
13791378
} {
1380-
testCase := testCase
13811379
t.Run(testCase.name, func(t *testing.T) {
13821380
fakeProvider := &mocks.MetricsProvider{}
13831381
testCase.testMetrics = &testMetrics{

orderer/common/cluster/commauth_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,6 @@ func TestBuildStepRespone(t *testing.T) {
457457
},
458458
}
459459
for _, tc := range tcs {
460-
tc := tc
461460
t.Run(tc.name, func(t *testing.T) {
462461
t.Parallel()
463462
res, err := cluster.BuildStepRespone(tc.input)

orderer/common/cluster/deliver_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,7 +1020,6 @@ func TestBlockPullerFailures(t *testing.T) {
10201020
failFunc: malformBlockSignatureAndRecreateOSNBuffer,
10211021
},
10221022
} {
1023-
testCase := testCase
10241023
t.Run(testCase.name, func(t *testing.T) {
10251024
testLogger.Infof("Starting test case: %s", testCase.name)
10261025
osn := newClusterNode(t)
@@ -1130,7 +1129,6 @@ func TestBlockPullerBadBlocks(t *testing.T) {
11301129
}
11311130

11321131
for _, testCase := range testcases {
1133-
testCase := testCase
11341132
t.Run(testCase.name, func(t *testing.T) {
11351133
osn := newClusterNode(t)
11361134
defer osn.stop()

orderer/common/cluster/service_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ func TestSubmitFailure(t *testing.T) {
160160
}
161161

162162
for _, testCase := range testCases {
163-
testCase := testCase
164163
t.Run(testCase.name, func(t *testing.T) {
165164
dispatcher := &mocks.Dispatcher{}
166165
stream := &mocks.StepStream{}

orderer/common/cluster/util_test.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,6 @@ func TestVerifyBlockHash(t *testing.T) {
293293
},
294294
},
295295
} {
296-
testCase := testCase
297296
t.Run(testCase.name, func(t *testing.T) {
298297
blockchain := createBlockChain(start, end)
299298
blockchain = testCase.mutateBlockSequence(blockchain)
@@ -693,7 +692,6 @@ func TestLastConfigBlock(t *testing.T) {
693692
blockRetriever: blockRetriever,
694693
},
695694
} {
696-
testCase := testCase
697695
t.Run(testCase.name, func(t *testing.T) {
698696
block, err := cluster.LastConfigBlock(testCase.block, testCase.blockRetriever)
699697
if testCase.expectedError == "" {
@@ -1267,7 +1265,6 @@ func TestCompareCertPublicKeysErrorHandling(t *testing.T) {
12671265
}
12681266

12691267
for _, tc := range testCases {
1270-
tc := tc
12711268
t.Run(tc.name, func(t *testing.T) {
12721269
t.Parallel()
12731270

@@ -1325,7 +1322,6 @@ func TestCompareCertPublicKeysWithMalformedCertificates(t *testing.T) {
13251322
}
13261323

13271324
for _, tc := range testCases {
1328-
tc := tc
13291325
t.Run(tc.name, func(t *testing.T) {
13301326
t.Parallel()
13311327

orderer/consensus/etcdraft/eviction_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,6 @@ func TestEvictionSuspector(t *testing.T) {
213213
},
214214
},
215215
} {
216-
testCase := testCase
217216
t.Run(testCase.description, func(t *testing.T) {
218217
committedBlocks := make(chan *common.Block, 2)
219218

orderer/consensus/smartbft/configverifier_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,6 @@ func TestValidateConfig(t *testing.T) {
237237
expectedError: "error proposing config update",
238238
},
239239
} {
240-
testCase := testCase
241240
t.Run(testCase.name, func(t *testing.T) {
242241
cup := &mocks.ConfigUpdateProposer{}
243242
f := &mocks.Filters{}

0 commit comments

Comments
 (0)