diff --git a/pool_test.go b/pool_test.go index ad1c4b8..b9a55b9 100644 --- a/pool_test.go +++ b/pool_test.go @@ -94,7 +94,8 @@ func TestPriorityPool_Submit(t *testing.T) { wg.Add(poolCap) for i := 0; i < poolCap; i++ { - err = p.Submit(lowPriority, taskGenerator(i, nil, wg)) + id := i + err = p.Submit(lowPriority, taskGenerator(id, nil, wg)) require.NoError(t, err) } @@ -114,7 +115,8 @@ func TestPriorityPool_Submit(t *testing.T) { wg.Add(n) for i := 0; i < n; i++ { - err = p.Submit(lowPriority, taskGenerator(i, nil, wg)) + id := i + err = p.Submit(lowPriority, taskGenerator(id, nil, wg)) require.NoError(t, err) }