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:
Aliaksandr Valialkin
2026-01-27 00:29:44 +01:00
parent 6bbc03ecf8
commit e35a9a366c
66 changed files with 335 additions and 633 deletions

View File

@@ -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()