mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2026-05-17 08:36:55 +03:00
all: consistently use sync.WaitGroup.Go() instead of sync.WaitGroup.Add(1) + sync.WaitGroup.Done()
This improves code readability a bit.
This commit is contained in:
@@ -226,15 +226,13 @@ func Stop(addrs []string) error {
|
||||
if addr == "" {
|
||||
continue
|
||||
}
|
||||
wg.Add(1)
|
||||
go func(addr string) {
|
||||
wg.Go(func() {
|
||||
if err := stop(addr); err != nil {
|
||||
errGlobalLock.Lock()
|
||||
errGlobal = err
|
||||
errGlobalLock.Unlock()
|
||||
}
|
||||
wg.Done()
|
||||
}(addr)
|
||||
})
|
||||
}
|
||||
wg.Wait()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user