Original post

Hey r/golang community,

at the moment I face a problem where I want to write the output of `exec.Cmd` commands to multiple writers. For this problem I created a struct, `MultiplexedWriter`, which holds all writers where it writes to.

You can view a working example on my gist.github account:
https://gist.github.com/SimonBaeumer/504e6c7f5747154872c88eb5eb827a48

I asked this question on StackOverflow and would appreciate every help or hint!

https://stackoverflow.com/questions/59747920/writing-stderr-and-stdout-streams-to-multiple-writers-creates-inconsistent-resul

My assumption is that the problem is in the implementation of the `exec` package itself but I am not quiet sure…

Thanks in advance!