func New(opts ...Option) *Group {
	g := &Group{
		waitErr: make(chan struct{}),
	}
	for _, opt := range opts {
		opt(g)
	}
	if g.ctx == nil {
		g.ctx = context.Background()
	}
	g.ctx, g.cancel = context.WithCancel(g.ctx)
	return g
}
New returns instance of the Group.
package taskgroup
import (
	"context"
	"errors"
	"sync"
)
var ErrTerminated = errors.New("taskgroup: terminated")
type Option func(g *Group)
func WithContext(ctx context.Context) Option {
	return func(g *Group) {
		g.ctx = ctx
	}
}