qixiaoning
2025-07-31 1fda1e433489e43387dbd082f8aba37d136755b2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
package util
 
import "sync"
 
type WaitGroupWrapper struct {
    sync.WaitGroup
}
 
func (w *WaitGroupWrapper) Wrap(b func()) {
    w.Add(1)
    go func() {
        b()
        w.Done()
    }()
}