Skip to content

Commit aa031b1

Browse files
committed
Make loc capture explicit
1 parent c0f61ce commit aa031b1

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

cmd/exec.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,15 +213,14 @@ func executeCommandInLocations(execCmd []string, locs []commandExecLocation, par
213213
go io.Copy(ptmx, os.Stdin)
214214
if parallel {
215215
wg.Add(1)
216-
loc := loc
217-
go func() {
216+
go func(loc commandExecLocation) {
218217
defer wg.Done()
219218

220219
err = cmd.Wait()
221220
if err != nil {
222221
log.Errorf("execution failed in %s (%s): %v", loc.Name, loc.Dir, err)
223222
}
224-
}()
223+
}(loc)
225224
} else {
226225
err = cmd.Wait()
227226
if err != nil {

0 commit comments

Comments
 (0)