fix(vet): Range var used by goroutine
* Use it as a paramater for the closure
This commit is contained in:
parent
0c7bb5a8f4
commit
3f1d4b0cee
|
@ -62,11 +62,11 @@ func (m *Mesos) Gather(acc telegraf.Accumulator) error {
|
|||
|
||||
for _, v := range m.Masters {
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
errorChannel <- m.gatherMetrics(v, acc)
|
||||
go func(c string) {
|
||||
errorChannel <- m.gatherMetrics(c, acc)
|
||||
wg.Done()
|
||||
return
|
||||
}()
|
||||
}(v)
|
||||
}
|
||||
|
||||
wg.Wait()
|
||||
|
|
Loading…
Reference in New Issue