-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More segment improvements #158
Conversation
Codecov Report
@@ Coverage Diff @@
## main #158 +/- ##
========================================
- Coverage 8.39% 8.37% -0.03%
========================================
Files 20 20
Lines 3394 3403 +9
========================================
Hits 285 285
- Misses 3057 3066 +9
Partials 52 52 |
cmd/exec.go
Outdated
@@ -213,6 +213,7 @@ func executeCommandInLocations(execCmd []string, locs []commandExecLocation, par | |||
go io.Copy(ptmx, os.Stdin) | |||
if parallel { | |||
wg.Add(1) | |||
loc := loc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the intention here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
capture the variable because it's used in the go routine below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, why not pass the variable to the goroutine as a parameter to make it explicit?
Like
go func(loc XXX) {
defer wg.Done()
err = cmd.Wait()
if err != nil {
log.Errorf("execution failed in %s (%s): %v", loc.Name, loc.Dir, err)
}
}(loc)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Description
Report build start and finish. Let's us detect build runner failures.