Goroutine creation can be simplified using WaitGroup.Go (modernize)

This commit is contained in:
Holger Obermaier
2026-02-13 15:52:36 +01:00
parent 3eaea4ca62
commit 5829f86f4a
3 changed files with 6 additions and 12 deletions

View File

@@ -102,9 +102,7 @@ func (c *metricCache) Start() {
return oldPeriod
}
c.wg.Add(1)
go func() {
defer c.wg.Done()
c.wg.Go(func() {
for {
select {
case <-c.done:
@@ -124,7 +122,7 @@ func (c *metricCache) Start() {
}
}
}
}()
})
cclog.ComponentDebug("MetricCache", "START")
}