Follow

Once again the fact that in golang you can't read a http.Request.Body multiple times, really stinks.

Β· Web Β· 2 Β· 0 Β· 1

@cj you must store it and guard it like the precious, precious resource that it is...

@cj I have more than one chunk of code that immediately copies r.Body into bytes.Buffer.
@tedu @cj I think most of us have that exact same code.
@cj @tedu It might end up like the `if err != nil` discussion. A proposal was put forth to optionally eliminate that piece of copy and paste and all of a sudden an army of go developers appeared to fight for the existence of that code. "It adds clarity! Yes I have a button mapped on my keyboard why do you ask?"
Sign in to participate in the conversation
Mastodon for Tech Folks

This Mastodon instance is for people interested in technology. Discussions aren't limited to technology, because tech folks shouldn't be limited to technology either! We adhere to an adapted version of the TootCat Code of Conduct and have documented a list of blocked instances. Ash is the admin and is supported by Fuzzface, Brian!, and Daniel Glus as moderators. Hosting costs are largely covered by our generous supporters on Patreon – thanks for all the help!