This repository has been archived by the owner on Jun 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 52
ioutil.ReadAll considered harmful #41
Comments
Thanks for the article. I'll take a look before making the switch. I've seen some reasons to read the entire body for HTTP/1.1 but I don't think they apply for HTTP/2.0. Decode and ReadAll behave a bit differently, but I imagine Decode would work just as well in this case. Nathan. |
Pretty convincing article. :D |
yeah I found it compelling, glad you did too, it certainly caused me to change some of my code, haha |
see #43. tests are passing :-) |
Awesome! :D |
I like that it removes a dependency to, no need to bring in ioutil. Cheers. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
http://jmoiron.net/blog/crossing-streams-a-love-letter-to-ioreader/ has some context on reasons to avoid a ReadAll. This fact is reflected in the current source - from the source:
If I'm undersatnding correctly, I believe this TODO could be done by essentially doing
and it would be beneficial for performance
The text was updated successfully, but these errors were encountered: