From 34ff2c228286420cfdadf2a6f8b7b7a108952d02 Mon Sep 17 00:00:00 2001 From: Andy Pan Date: Mon, 15 Apr 2024 18:13:28 +0800 Subject: [PATCH] chore: fix a few lint issues in code --- ants_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ants_test.go b/ants_test.go index a78ff2f..230972f 100644 --- a/ants_test.go +++ b/ants_test.go @@ -242,7 +242,7 @@ func TestPanicHandler(t *testing.T) { c := atomic.LoadInt64(&panicCounter) assert.EqualValuesf(t, 1, c, "panic handler didn't work, panicCounter: %d", c) assert.EqualValues(t, 0, p0.Running(), "pool should be empty after panic") - p1, err := NewPoolWithFunc(10, func(p interface{}) { panic(p) }, WithPanicHandler(func(p interface{}) { + p1, err := NewPoolWithFunc(10, func(p interface{}) { panic(p) }, WithPanicHandler(func(_ interface{}) { defer wg.Done() atomic.AddInt64(&panicCounter, 1) })) @@ -274,7 +274,7 @@ func TestPanicHandlerPreMalloc(t *testing.T) { c := atomic.LoadInt64(&panicCounter) assert.EqualValuesf(t, 1, c, "panic handler didn't work, panicCounter: %d", c) assert.EqualValues(t, 0, p0.Running(), "pool should be empty after panic") - p1, err := NewPoolWithFunc(10, func(p interface{}) { panic(p) }, WithPanicHandler(func(p interface{}) { + p1, err := NewPoolWithFunc(10, func(p interface{}) { panic(p) }, WithPanicHandler(func(_ interface{}) { defer wg.Done() atomic.AddInt64(&panicCounter, 1) })) @@ -667,7 +667,7 @@ func TestWithDisablePurgePoolFunc(t *testing.T) { var wg1, wg2 sync.WaitGroup wg1.Add(numWorker) wg2.Add(numWorker) - p, _ := NewPoolWithFunc(numWorker, func(i interface{}) { + p, _ := NewPoolWithFunc(numWorker, func(_ interface{}) { wg1.Done() <-sig wg2.Done() @@ -682,7 +682,7 @@ func TestWithDisablePurgeAndWithExpirationPoolFunc(t *testing.T) { wg1.Add(numWorker) wg2.Add(numWorker) expiredDuration := time.Millisecond * 100 - p, _ := NewPoolWithFunc(numWorker, func(i interface{}) { + p, _ := NewPoolWithFunc(numWorker, func(_ interface{}) { wg1.Done() <-sig wg2.Done() @@ -914,7 +914,7 @@ func TestPoolTuneScaleUp(t *testing.T) { p.Release() // test PoolWithFunc - pf, _ := NewPoolWithFunc(2, func(i interface{}) { + pf, _ := NewPoolWithFunc(2, func(_ interface{}) { <-c }) for i := 0; i < 2; i++ {