From 63e5633d6286e6c4bf94c2c6bb6bf52281bd28db Mon Sep 17 00:00:00 2001 From: Tibor Vass Date: Thu, 26 Sep 2019 18:01:12 +0000 Subject: [PATCH] build: fix scoping issue in closure inside loop Signed-off-by: Tibor Vass --- build/build.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/build.go b/build/build.go index f6c7eb21..9d60695f 100644 --- a/build/build.go +++ b/build/build.go @@ -541,7 +541,7 @@ func Build(ctx context.Context, drivers []DriverInfo, opt map[string]Options, do multiTarget := len(opt) > 1 for k, opt := range opt { - err := func() error { + err := func(k string) error { opt := opt dps := m[k] multiDriver := len(m[k]) > 1 @@ -685,7 +685,7 @@ func Build(ctx context.Context, drivers []DriverInfo, opt map[string]Options, do } return nil - }() + }(k) if err != nil { return nil, err }