Go 1.13 introduces new features to the errors to simplify working with errors. Before Go 1.13, I checked my code for an error by this way:
if err == nil {
// ...
}
But Go's errors.Is() helps me to do it properly:
It’s a sensible way to future-proof your code and prevent issues caused by you — or any packages that your code imports — wrapping errors in the future.
And that is ok for situations like this:
if errors.Is(err, sql.ErrNoRows) {
// ...
}
Does it mean that I have to change all my err == nil statements to:
if errors.Is(err, nil) {
// ...
}