3 ms·
> all you want to do is return an error Nope. This isn't even true in all situations. For a simple example, just look at description of the extremely popular i
by svnpenn 4y ago
> all you want to do is return an error
Nope. This isn't even true in all situations. For a simple example, just look at description of the extremely popular io.Reader:
> An instance of this general case is that a Reader returning a non-zero number of bytes at the end of the input stream may return either err == EOF or err == nil.
https://godocs.io/io#Reader https://godocs.io/io#Reader
- the_gipsy 4y agoIn 99% of situations you do not check the error type nor the value, like io.Reader.