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

@@ -291,9 +291,7 @@ func (r *metricRouter) Start() {
r.cache.Start()
}
r.wg.Add(1)
go func() {
defer r.wg.Done()
r.wg.Go(func() {
for {
select {
@@ -324,7 +322,7 @@ func (r *metricRouter) Start() {
}
}
}
}()
})
cclog.ComponentDebug("MetricRouter", "STARTED")
}