-
-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
The consumer uses func(ls []interface{}) error
which requires that all elements be individually cast:
consumer := func(ls []interface{}) error {
var items []int
for _, item := range items {
items = append(items, item.(int))
}
// ...
return nil
}
Using reflect
you could have a dynamic signature (which would be backwards compatible with []interface{}
):
consumer := func(ls []int) error {
fmt.Printf("get %+v \n", ls)
wg.Add(-len(ls))
return nil
}
Metadata
Metadata
Assignees
Labels
No labels