Anyone who’s curious why `errors.Is()` is so slow (relatively speaking) should read the implementation [0]. It’s pretty obvious once you read the code—it relies on reflection followed by a tree-walking algorithm.
[0]: https://github.com/golang/go/blob/9b43bfbc51c469ec13fca24960...