api/pkg/wait/wg.go

15 lines
199 B
Go
Raw Normal View History

2021-01-13 16:59:08 +00:00
package wait
import "sync"
func ForWaitGroupDone(wg *sync.WaitGroup) <-chan struct{} {
done := make(chan struct{})
go func(wg *sync.WaitGroup) {
wg.Wait()
close(done)
}(wg)
return done
}