by randomdata · 8y ago · 0 comments
Or is the correct fix to use errgroup[1]?
func doSomethingTwice() error {
var g errgroup.Group
g.Go(func() error {
defer fmt.Println("done wth a")
return doSomething("a")
})
g.Go(func() error {
defer fmt.Println("done with b")
return doSomething("b")
})
return g.Wait()
}
[1] https://godoc.org/golang.org/x/sync/errgroupNo comments yet.