Or alternatively, I just missed something stupid.
Summary:
Decoding from a bytes.Buffer works.
Decoding from a httptest errors with "EOF"
Example code:
Output with 1.4:
$ go run lalatest.go
Decoding with bytes.Buffer: <nil>
Decoding with http stream: <nil>
Yes, "{ \"foo\": \"bar\" }" really is "{ \"foo\": \"bar\" }"
Output with tip (129cfa2745a3db0fd55fd13fd46da0e75b9ce7dc):
$ go run lalatest.go
Decoding with bytes.Buffer: <nil>
Decoding with http stream: EOF
Yes, "{ \"foo\": \"bar\" }" really is "{ \"foo\": \"bar\" }"
I don't expect any differences in decoding the same data (it really should be the same data) from a bytes.Buffer and over HTTP.
Some more verbose example: