mirror of
https://github.com/ClusterCockpit/cc-metric-collector.git
synced 2026-02-14 07:01:45 +01:00
Goroutine creation can be simplified using WaitGroup.Go (modernize)
This commit is contained in:
@@ -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")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user