Skip to content

Latest commit

 

History

History
26 lines (19 loc) · 648 Bytes

README.md

File metadata and controls

26 lines (19 loc) · 648 Bytes

gogroup Go ReferenceGo Report Card

gogroup provides a group of goroutines used to run functions concurrently.

Usage

var g gogroup.Group

g.Add(func(ctx context.Context) error {
	// do something
	return nil
})

g.Add(func(ctx context.Context) error {
	// convert panic as an error and cancel the context
	panic("panic")
})

if err := g.Run(ctx); err != nil {
	return err
}

License

MIT