exec.CombinedOutput uses the same io.Writer for both stdout and stderr in exec.go - Go (opensource.google) <https://cs.opensource.google/go/go/+/refs/tags/go1.21.1:src/os/exec/exec.go;l=1003> . This io.Writer is written in exec.go - Go (opensource.google) <https://cs.opensource.google/go/go/+/refs/tags/go1.21.1:src/os/exec/exec.go;l=717> . These two writes happens concurrently in two goroutines in exec.go - Go (opensource.google) <https://cs.opensource.google/go/go/+/refs/tags/go1.21.1:src/os/exec/exec.go;l=717> . As far as I know, bytes.Buffer is not safe to concurrent writes. Is this not a race?
-- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/c8287fa4-8e9b-46bb-a2aa-7abd56157cdcn%40googlegroups.com.