go
go copied to clipboard
Compare errors using `errors.Is`
Hi, thanks for this nice project :sparkles:!
Now, as of Go 1.13 if I recall correctly, there is a new way to compare errors using the errors.Is
method in the standard library.
This could be done instead of checking for equality directly if err != io.EOF
e.g. like here. This allows for custom errors to be returned from e.g. the underlying io.Reader
and still be compliant to errors.Is(err, io.EOF)
as the error returned implements the Is(err error) bool
interface, as described in the errors
package.
I would be happy to contribute this change if approved :)