2 ms·
Yes, that's correct. The interface limits what guarantees the caller has about the type without runtime introspection. I don't think that really makes it any ha
by MobiusHorizons 9mo ago
Yes, that's correct. The interface limits what guarantees the caller has about the type without runtime introspection. I don't think that really makes it any harder to handle expected error conditions though, since type assertions return a boolean. eg:
if myErr, ok := err.(MyError); ok {
// handle MyError case
}
...
But you should always expect that there could be errors you don't expect to exhaustively handle with special logic.