The Go bytes.Buffer
isn't thread-safe. Yet, when I read the source code I notice that os/exec.CombinedOutput()
uses the same buffer for both c.Stdout
and c.Stderr
. Further reading the implementation of the package it looks like there is no synchronisation when writing to the c.Stderr
/c.Stdout
here.
Am I missing something or have I found a possible synchronisation issue? AFAIK stderr and stdout can be written to concurrently by the child process.