Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumGoerrgroup and fan-outSingle-choice MCQ

In this fan-out using errgroup, what does Wait() return and how many goroutine errors are observable?

package main import ( "errors" "fmt" "golang.org/x/sync/errgroup" ) func main() { var g errgroup.Group errA := errors.New("A") errB := errors.New("B") g.Go(func() error { return errA }) g.Go(func() error { return errB }) fmt.Println(g.Wait()) }