No, I can't use a bufio because if I json.Unmarshal() fails (which will happen if a newer version of docker speaks to an older version of docker -d) I can't put the data back into the buffer for Read(). Hence, doing everything manually is simpler here. I'm adding a comment of this.