4 ms·
Your #1 issue is mentioned clearly in the documentation. Mentioning here verbatim - > The http Client and Transport guarantee that Body is always non-nil, eve
by agnivade 9y ago
Your #1 issue is mentioned clearly in the documentation.
Mentioning here verbatim -
> The http Client and Transport guarantee that Body is always
non-nil, even on responses without a body or responses with
a zero-length body. It is the caller's responsibility to
close Body. The default HTTP client's Transport may not
reuse HTTP/1.x "keep-alive" TCP connections if the Body is
not read to completion and closed.
Regarding #2, I think what you are taking about is this - https://blog.golang.org/go-slices-usage-and-internals https://blog.golang.org/go-slices-usage-and-internals (gotcha section). But maybe I am wrong.