Comment

Comment by gandreani

I find it kind of amusing to consider that the go team didn't commit to implement this automatic connection re-use until they probably encountered in the wild the horrible but correct third iteration of drainAndCloseBody.

1. Suggest drainAndCloseBody // Team: this is reasonable

2. Implement drainAndCloseBodyWithTimer // Team: no problems here

3. then drainAsyncAndCloseBodyWithTimer // Team: a bit wordy but no problem here

4. Someone at google uses 3. with an http/2 connection // Team: this is where we draw the line?

I sympathize with the struggle of following golang's mission to be simple when you consider this common but tricky edge case. Iteration 3 makes sense but by gosh is it ugly ha.

parent gandreani 17 days ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton