2 ms·
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 ex
by hackworks 7y 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!
- apta 7y ago`instanceof` in Java can be surprisingly fast. Plus, it seems that errors.Is and As rely on reflection, which is slow in golang.