mirror of
https://github.com/yusing/godoxy.git
synced 2026-03-23 09:31:02 +01:00
refactor(concurrency): replaced manual WaitGroup management with new wg.Go() and removed redundant code.
This commit is contained in:
@@ -23,11 +23,9 @@ import (
|
||||
func parallel(fns ...func()) {
|
||||
var wg sync.WaitGroup
|
||||
for _, fn := range fns {
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
fn()
|
||||
}()
|
||||
})
|
||||
}
|
||||
wg.Wait()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user