Remix.run Logo
▲ gandreani 4 hours ago

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.