Skip to content(if available)orjump to list(if available)

The Day the Linter Broke My Code

The Day the Linter Broke My Code

3 comments

·September 15, 2025

ecnahc515

If the the OP is the author, did consider filing a bug with errcheck? It should be possible for errcheck to check if the comparison is being done within an `Is(err error) bool` method and skip the warning in that case, or even better: it could check if your using `errors.Is` within an `Is` method and warn in that case!

cronelius

Isn't this what Unwrap() is for? errors.Is calls Unwrap if it's available and then compares _that_ error.

eik

Having looked at the problems that can arise with errors.As:

https://news.ycombinator.com/item?id=44959638

Let's now look at how errors.Is can introduce subtle bugs that can affect the reliability of error checking, especially when trying to determine the root cause of an error.

How one letter can make such a difference…