fix
This commit is contained in:
17
pkg/util/wait_group_wrapper.go
Normal file
17
pkg/util/wait_group_wrapper.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package util
|
||||
|
||||
import (
|
||||
"sync"
|
||||
)
|
||||
|
||||
type WaitGroupWrapper struct {
|
||||
sync.WaitGroup
|
||||
}
|
||||
|
||||
func (w *WaitGroupWrapper) Wrap(cb func()) {
|
||||
w.Add(1)
|
||||
go func() {
|
||||
cb()
|
||||
w.Done()
|
||||
}()
|
||||
}
|
||||
Reference in New Issue
Block a user