Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.

make combinedOutput actually output both stdout and stderr #881

Merged
merged 1 commit into from Jul 31, 2017

Conversation

erizocosmico
Copy link
Contributor

What does this do / why do we need it?

When the command exits with status 0, combinedOutput should return the output of both stderr and stdout combined. Previously, it only returned stdout contents.

What should your reviewer look out for in this PR?

Maybe the syncBuffer is a bit of an overkill? After all, stdlib's CombinedOutput uses a bytes.Buffer for both without any mutex.

Do you need help or clarification on anything?

Which issue(s) does this PR fix?

I think none, just saw the TODO and started fixing this

@sdboyer
Copy link
Member

sdboyer commented Jul 23, 2017

ahh, that's the license header checker. (need a rebase, too)

@erizocosmico erizocosmico force-pushed the fix/cmd-combined-output branch 2 times, most recently from 7b470dc to 61047b0 Compare July 23, 2017 22:08
@erizocosmico
Copy link
Contributor Author

Oopsie, fixed!

@@ -22,6 +23,7 @@ import (
type monitoredCmd struct {
cmd *exec.Cmd
timeout time.Duration
output *syncBuffer
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, this seems like it might be overkill, per your note in the OP.

what if instead, if the user calls monitoredCmd.combinedOutput(), then we just reuse one of the activityBuffers - e.g., assign cmd.stdout to cmd.stderr? i can't think of any immediate problems with that...

@erizocosmico erizocosmico force-pushed the fix/cmd-combined-output branch 2 times, most recently from 4323cd0 to 94ceb20 Compare July 26, 2017 18:46
Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
@erizocosmico
Copy link
Contributor Author

Done @sdboyer!

Copy link
Member

@sdboyer sdboyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes! if this works, then it LGTM.

@sdboyer
Copy link
Member

sdboyer commented Jul 26, 2017

cool!

hmm, that failure's on a test that i believe we're refactoring, anyway. easiest thing is probably to hang tight for a few days while we get that sorted.

@sdboyer
Copy link
Member

sdboyer commented Jul 31, 2017

eh, i'm not going to leave this hanging - the failure is unrelated. in we go.

@sdboyer sdboyer merged commit b6765a5 into golang:master Jul 31, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants