Skip to content

Commit

Permalink
Make loc capture explicit
Browse files Browse the repository at this point in the history
  • Loading branch information
csweichel committed Jul 4, 2023
1 parent c0f61ce commit aa031b1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cmd/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,15 +213,14 @@ func executeCommandInLocations(execCmd []string, locs []commandExecLocation, par
go io.Copy(ptmx, os.Stdin)
if parallel {
wg.Add(1)
loc := loc
go func() {
go func(loc commandExecLocation) {
defer wg.Done()

err = cmd.Wait()
if err != nil {
log.Errorf("execution failed in %s (%s): %v", loc.Name, loc.Dir, err)
}
}()
}(loc)
} else {
err = cmd.Wait()
if err != nil {
Expand Down

0 comments on commit aa031b1

Please sign in to comment.