Skip to content

swapped-errors-is-arguments

Default severity: error

errors.Is expects the error being inspected first and the target sentinel second. A package-level sentinel from another package in the first position, followed by a local error value, usually means the arguments were reversed.

errors.Is(io.EOF, err)
errors.Is(err, io.EOF)