4 ms·
I think it's probably confusing until you understand interfaces, which coming from other languages you might not be familiar with (my guess for what happened in
by dematz 9mo ago
I think it's probably confusing until you understand interfaces, which coming from other languages you might not be familiar with (my guess for what happened in this blog post). If you don't know what an interface is then maybe you assume err.Error() is some kind of string, without realizing Error() is just a required function but the err could be whatever type.
- benrazdev 9mo agoMy understanding is that using `error` as a return type performs type erasure and that the only information given to the caller is the value of the `e.Error()` function. I now understand that this isn't the case.