build: use copy for BuildWithResultHandler loop vars

Signed-off-by: Justin Chadwell <me@jedevc.com>
This commit is contained in:
Justin Chadwell 2023-01-09 16:46:40 +00:00
parent fb27e3f919
commit 347417ee12

View File

@ -1072,7 +1072,7 @@ func BuildWithResultHandler(ctx context.Context, nodes []builder.Node, opt map[s
})
for i, dp := range dps {
so := *dp.so
i, dp, so := i, dp, *dp.so
if multiDriver {
for i, e := range so.Exports {
switch e.Type {
@ -1101,7 +1101,6 @@ func BuildWithResultHandler(ctx context.Context, nodes []builder.Node, opt map[s
}
}
func(i int, dp driverPair, so client.SolveOpt) {
pw := progress.WithPrefix(w, k, multiTarget)
c := clients[dp.driverIndex]
@ -1237,8 +1236,6 @@ func BuildWithResultHandler(ctx context.Context, nodes []builder.Node, opt map[s
}
return nil
})
}(i, dp, so)
}
return nil