Skip to content

Instantly share code, notes, and snippets.

View aybabtme's full-sized avatar
👶
I may be slow to respond. Newborn in the house.

Antoine Grondin aybabtme

👶
I may be slow to respond. Newborn in the house.
View GitHub Profile
//go:generate pipeliner map(func(string) (string, error) concurrently as concErrMap into conc_err_map.go
func concErrMap(concurrency int, fn func(string) (string, error), in <-chan string) (<-chan string, <-chan error) {
out := make(chan string)
errc := make(chan error, concurrency)
done := make(chan struct{})
go func() {
defer close(out)
defer close(errc)
wg := sync.WaitGroup{}
wg.Add(concurrency)