@@ -38,7 +38,6 @@ func TestConcurrentClient(t *testing.T) {
3838
3939 pool := gopool .NewPool ()
4040 err := pool .Go (requests ... ).Wait ()
41- defer pool .Close ()
4241
4342 t .Run ("No errors" , func (t * testing.T ) {
4443 assert .NoError (t , err )
@@ -106,7 +105,7 @@ func TestConcurrentClientWithRetry(t *testing.T) {
106105
107106 pool := gopool .NewPool ()
108107 err := pool .Go (requests ... ).Wait ()
109- defer pool . Close ()
108+
110109 t .Run ("6 requests done" , func (t * testing.T ) {
111110 assert .Equal (t , 6 , numInvocations )
112111 })
@@ -142,7 +141,7 @@ func TestConcurrentClientWithRetryFailure(t *testing.T) {
142141 }
143142
144143 pool := gopool .NewPool ()
145- defer pool . Close ()
144+
146145 err := pool .Go (requests ... ).Wait ()
147146 t .Run ("6 requests done" , func (t * testing.T ) {
148147 assert .Equal (t , 6 , numInvocations )
@@ -177,8 +176,9 @@ func TestConcurrentClientWithAllRetry(t *testing.T) {
177176 }),
178177 }
179178
180- pool := gopool .NewPool ().WithRetry (3 , 100 * time .Millisecond )
181- defer pool .Close ()
179+ pool := gopool .NewPool ()
180+ pool .WithRetry (3 , 100 * time .Millisecond )
181+
182182 err := pool .Go (requests ... ).Wait ()
183183 t .Run ("5 requests done" , func (t * testing.T ) {
184184 assert .Equal (t , 5 , numInvocations )
@@ -206,7 +206,7 @@ func TestConcurrentClientWithTaskChannel(t *testing.T) {
206206 }
207207
208208 pool := gopool .NewPool ()
209- defer pool . Close ()
209+
210210 // Run the Task(s)
211211 err := pool .Go (requests ... ).Wait ()
212212
@@ -251,7 +251,7 @@ func TestConcurrentClientWith2WorkersameChannel(t *testing.T) {
251251 }
252252
253253 pool := gopool .NewPool ()
254- defer pool . Close ()
254+
255255 // Run the Task(s)
256256 err := pool .Go (requests ... ).Wait ()
257257
@@ -298,7 +298,7 @@ func TestConcurrentClientWith2TaskDiffTypes(t *testing.T) {
298298 }
299299
300300 pool := gopool .NewPool ()
301- defer pool . Close ()
301+
302302 // Run the Task(s)
303303 err := pool .Go (requests ... ).Wait ()
304304
@@ -347,7 +347,7 @@ func TestConcurrentClientWith2TaskDiffTypes1Output(t *testing.T) {
347347 }
348348
349349 pool := gopool .NewPool ()
350- defer pool . Close ()
350+
351351 // Run the Task(s)
352352 err := pool .Go (requests ... ).Wait ()
353353
@@ -382,7 +382,7 @@ func TestConcurrentClientWith2TaskDiffTypes1Output1Input(t *testing.T) {
382382 return nil
383383 }
384384
385- tFunc2 := func (t gopool.Args [typeB ]) error {
385+ tFunc2 := func (t gopool.Args [* typeB ]) error {
386386 numInvocations ++
387387
388388 // update
@@ -396,7 +396,7 @@ func TestConcurrentClientWith2TaskDiffTypes1Output1Input(t *testing.T) {
396396 }
397397
398398 pool := gopool .NewPool ()
399- defer pool . Close ()
399+
400400 // Run the Task(s)
401401 err := pool .Go (requests ... ).Wait ()
402402
0 commit comments