3 ms·
It means that there's nothing in the API that tells you whether the function might spawn a goroutine. It has to document it. I don't remember the precise detai
by eridius 12y ago
It means that there's nothing in the API that tells you whether the function might spawn a goroutine. It has to document it.
I don't remember the precise details anymore, but my recollection is I was spawning a child process and passing Writers to use for stdout and stderr (looking at os.exec, I don't immediately see anything that matches my recollection, so I'm wondering if maybe I was using a different package). I expected that it would internally do something like select over stdout and stderr in one goroutine, therefore making it safe for me to pass the same buffer object for both (because I wanted to combine writes). But instead it was spawning 2 goroutines, not 1. And there was no evidence in the API that what I was doing was wrong, the only way to know was for the data race detector to flag it.