Hacker News new | ask | show | jobs
by minighost 842 days ago
A function that both opens a file and does something with its contents should be refactored. It’s painful to find code like this and happen to have a string or pointer to some buffer that already contains the data that needs to be converted but the conversion function is buried inside a function that tries to open a file. Go’s io.Reader is so elegant at this.