You set g.SetLimit(2) on an errgroup.Group, then loop calling g.Go for 100 tasks. What is the effect of SetLimit on the g.Go calls?
g := new(errgroup.Group)
g.SetLimit(2)
for _, task := range tasks {
task := task
g.Go(func() error { return process(task) })
}
_ = g.Wait()