Hacker News new | ask | show | jobs
by hackworks 2433 days ago
Almost every language supporting inheritance suffers from lack of ability to check if an error is part of the derivation chain. I have implemented this using expensive dynamic cast in C++ and instanceof in Java.

Finally Go gets it ahead of the other languages!

1 comments

`instanceof` in Java can be surprisingly fast. Plus, it seems that errors.Is and As rely on reflection, which is slow in golang.