Skip to content

Commit 02325ee

Browse files
committed
refactor: omit unnecessary reassignment
Signed-off-by: rifeplight <rifeplight@outlook.com>
1 parent 1e27c70 commit 02325ee

2 files changed

Lines changed: 0 additions & 6 deletions

File tree

accounts/abi/event_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,6 @@ func TestEventTupleUnpack(t *testing.T) {
331331

332332
for _, tc := range testCases {
333333
assert := assert.New(t)
334-
tc := tc
335334
t.Run(tc.name, func(t *testing.T) {
336335
err := unpackTestEventData(tc.dest, tc.data, tc.jsonLog, assert)
337336
if tc.error == "" {

node/node_test.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ func TestServiceLifeCycle(t *testing.T) {
163163
stopped := make(map[string]bool)
164164

165165
for id, maker := range services {
166-
id := id // Closure for the constructor
167166
constructor := func(*ServiceContext) (Service, error) {
168167
return &InstrumentedService{
169168
startHook: func() { started[id] = true },
@@ -263,7 +262,6 @@ func TestServiceConstructionAbortion(t *testing.T) {
263262
}
264263
started := make(map[string]bool)
265264
for id, maker := range services {
266-
id := id // Closure for the constructor
267265
constructor := func(*ServiceContext) (Service, error) {
268266
return &InstrumentedService{
269267
startHook: func() { started[id] = true },
@@ -314,7 +312,6 @@ func TestServiceStartupAbortion(t *testing.T) {
314312
stopped := make(map[string]bool)
315313

316314
for id, maker := range services {
317-
id := id // Closure for the constructor
318315
constructor := func(*ServiceContext) (Service, error) {
319316
return &InstrumentedService{
320317
startHook: func() { started[id] = true },
@@ -369,7 +366,6 @@ func TestServiceTerminationGuarantee(t *testing.T) {
369366
stopped := make(map[string]bool)
370367

371368
for id, maker := range services {
372-
id := id // Closure for the constructor
373369
constructor := func(*ServiceContext) (Service, error) {
374370
return &InstrumentedService{
375371
startHook: func() { started[id] = true },
@@ -555,7 +551,6 @@ func TestAPIGather(t *testing.T) {
555551
}
556552

557553
for id, config := range services {
558-
config := config
559554
constructor := func(*ServiceContext) (Service, error) {
560555
return &InstrumentedService{apis: config.APIs}, nil
561556
}

0 commit comments

Comments
 (0)