Skip to content

Commit c6c22d2

Browse files
committed
chore(example): check error
Signed-off-by: Bo-Yi Wu <[email protected]>
1 parent 8fa622a commit c6c22d2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

_example/example02/main.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,12 @@ func main() {
3333
// assign tasks in queue
3434
for i := 0; i < taskN; i++ {
3535
go func(i int) {
36-
q.QueueTask(func(ctx context.Context) error {
36+
if err := q.QueueTask(func(ctx context.Context) error {
3737
rets <- fmt.Sprintf("Hi appleboy, handle the job: %02d", +i)
3838
return nil
39-
})
39+
}); err != nil {
40+
panic(err)
41+
}
4042
}(i)
4143
}
4244

0 commit comments

Comments
 (0)