3 ms·
FWIW, persistence of I/O errors is precisely how stdio works in C. When fwrite encounters an error it will continue to return failure (for the same FILE handle)
by wahern 8y ago
FWIW, persistence of I/O errors is precisely how stdio works in C. When fwrite encounters an error it will continue to return failure (for the same FILE handle) until invoking clearerr. ferror is used to query the error value.
- Groxx 8y agoAnd I dislike the persistent-error setup in Rob Pike's example for the same reason as disliking global errs in C: they're easy to forget, especially because they're abnormal. And history keeps showing these things being forgotten in large numbers, so I don't see why it wouldn't repeat with Go.