Hacker News new | ask | show | jobs
by za3faran 700 days ago
There was a bug in the golang standard lib that was basically exactly due to that behavior. It seems that even the golang authors made such a mistake.
1 comments

I can’t find it but IIRC the issue was mostly the internal use of reflection, possibly undocumented e.g. a function. Would take a reader, then do a thing, then close it if possible.

But it did not take a closeable reader, it’d just ask for a reader and close it from under you. And maybe this caught people who did not intend to implement a readcloser but it definitely caught people who just didn’t want their file closed because they had shit to do with it afterwards.