On Mon, 27 Feb 2017, at 11:39 AM, dc0d wrote:

> Is there any drawbacks if we put the CancelFunc of a cancellable
> context.Context inside it's values?
> 

> Problem: I needed a cross breed of WaitGroup and Context. So a
> WaitGroup and it's CancelFunc is put inside it's values and are used
> with some helper functions. I wrote a variant of WaitGroup - with some
> needed features - but I see this pattern of accepting an argument like
> "ctx context.Context" as the first argument in functions. So I though
> it might be more idiomatic to use the Context instead. Any
> thoughts/suggestions?


Have a look at https://godoc.org/github.com/golang/sync/errgroup which
seems to cover your use case


Ian

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to