Re: [go-nuts] Does errgroup kills non_error_gouroutines

2020-05-27 Thread Amarjeet Anand
Thanks for your response. Got it. On Wed, 27 May, 2020, 6:22 PM Tamás Gulácsi, wrote: > errgroup does not terminate. > But will signal the (sub)context returned by WithContext when any > goroutine returns with an error. > > So if your functions handle the context cancelation by exiting, then you

[go-nuts] Does errgroup kills non_error_gouroutines

2020-05-27 Thread Tamás Gulácsi
errgroup does not terminate. But will signal the (sub)context returned by WithContext when any goroutine returns with an error. So if your functions handle the context cancelation by exiting, then you can cancel other goroutines. I asvice using such sub context with requests, too. -- You rece

[go-nuts] Does errgroup kills non_error_gouroutines

2020-05-27 Thread Amarjeet Anand
Code from https://pkg.go.dev/golang.org/x/sync/errgroup?tab=doc var g errgroup.Group var urls = []string{ "http://www.golang.org/";, "http://www.google.com/";, "http://www.somestupidname.com/";, } for _, url := range urls { url := url g.Go(func() error {