In the Go programming language, is bytes.Buffer
thread-safe? AFAIK, its documentation does not mention thread safety.
Unfortunatelly I didn't know about https://golang.org/pkg/io/#Pipe, so implemented this thing myself. Here it is: https://github.com/latitov/milkthisbuffer
I understand that it is useless when there's standard io.Pipe thing, but just in case anyone is interested in how you may reinvent the bicycle, only to discover few hours later that you just did exactly that - invented the bicycle ))
Besides, it's mutex/locks free.