From 3f1d4b0ceefaaf10c03e42ea58e01e5f61763c00 Mon Sep 17 00:00:00 2001 From: Sergio Jimenez Date: Thu, 11 Feb 2016 01:18:53 +0100 Subject: [PATCH] fix(vet): Range var used by goroutine * Use it as a paramater for the closure --- plugins/inputs/mesos/mesos.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/inputs/mesos/mesos.go b/plugins/inputs/mesos/mesos.go index 843ebb0ef..0f9bd5573 100644 --- a/plugins/inputs/mesos/mesos.go +++ b/plugins/inputs/mesos/mesos.go @@ -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()