3 ms·
There are at least two places in the standard library that behave like this: sql.ErrNoRows and the error thrown by os.Open when a file doesn't exist.
by abound 2y ago
There are at least two places in the standard library that behave like this: sql.ErrNoRows and the error thrown by os.Open when a file doesn't exist.
- manlobster 2y agoTrue, but both of these are for relatively slow operations, where the performance of the error checking is relatively insignificant.
- zachmu 2y agoIt has also become somewhat common to use io.EOF to signal the end of iteration, like the reader libraries do.