We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The consumer uses func(ls []interface{}) error which requires that all elements be individually cast:
func(ls []interface{}) error
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{}):
reflect
[]interface{}
consumer := func(ls []int) error { fmt.Printf("get %+v \n", ls) wg.Add(-len(ls)) return nil }
The text was updated successfully, but these errors were encountered:
Hi elliotchance, Do you have any PR to improve this?
Sorry, something went wrong.
No branches or pull requests
The consumer uses
func(ls []interface{}) error
which requires that all elements be individually cast:Using
reflect
you could have a dynamic signature (which would be backwards compatible with[]interface{}
):The text was updated successfully, but these errors were encountered: