qixiaoning
2025-07-24 343a89f9fa20d2d142469b2a4531e16ce03d3525
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()
    }()
}