In pseudo-code, something like this happens: > req := http.NewRequest("POST", url, body) > ... > body.reset()
On Monday, 22 July 2019 17:38:14 UTC+3, Gabriel Aszalos wrote: > > I have an odd race condition occasionally occurring in my code (hard to > reproduce in non-production environment) but it might be hinting at the > fact that `http.Client.Do <http://http.client.do/>` might be reading the > `http.Request.Body` *after* it returns. Is this possible? I am re-using the > same request body throughout requests. I've tried to dig into the net/http > code but can't really figure it out. Looking simply at `http.Client.do > <http://http.client.do/>`, it seems like the request body is always > closed before each return (except the sentinel error from CheckRedirect, > which we're not using). > -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/b6b4ec00-24c8-4dc2-8a09-69b91594fa9b%40googlegroups.com.