mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-07-26 06:38:42 +00:00
sync: add WaitGroup.Go
This commit is contained in:
@@ -83,3 +83,11 @@ func (wg *WaitGroup) Wait() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (wg *WaitGroup) Go(f func()) {
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
f()
|
||||
}()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user