On Mon, Sep 10, 2018, at 09:27, Pierre Durand wrote:
> When I learned Go a few years ago, I was told to always defer/close the
> HTTP request body, otherwise it will cause a resource leak.
>
> But today I read this: https://golang.org/pkg/net/http/#Request.Body
> // The Server will close the request body. The ServeHTTP
> // Handler does not need to.
>
> Am I misunderstanding something ?
The rule is that HTTP *clients* must close the *response* body. Servers handle
closing the request body themselves.
—Sam
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.