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

@@ -123,9 +123,7 @@ func (cm *collectorManager) Start() {
tick := make(chan time.Time)
cm.ticker.AddChannel(tick)
cm.wg.Add(1)
go func() {
defer cm.wg.Done()
cm.wg.Go(func() {
// Collector manager is done
done := func() {
// close all metric collectors
@@ -180,7 +178,7 @@ func (cm *collectorManager) Start() {
}
}
}
}()
})
// Collector manager is started
cclog.ComponentDebug("CollectorManager", "STARTED")