Closed
Description
It is currently possible for a request body to be read, even after http.Client.Do
returns. This can be a source of potential race conditions. It is currently unclear in the documentation that this can happen. To the contrary, the documentation is hinting at the fact that the request body will be closed after the function returns, at least to my understanding. To illustrate, the attached playground example reproduces the problem, when compiled with the -race
flag:
https://play.golang.org/p/Z0t0QEawcev
The purpose of this issue is to clarify whether:
- This is a bug?
- Documentation can be improved?
Useful links: