4 ms·
The real issue here is that it is not immediately obvious that this is actually an interface - one expects the second `err` to be *FormatError due to the signat
by chrsm 8y ago
The real issue here is that it is not immediately obvious that this is actually an interface - one expects the second `err` to be *FormatError due to the signature - it happens to implement the error interface so it goes unnoticed.
Shadowing in a different scope allows it to work properly as well.
I admit that I've never actually run in to this issue in practice as I generally return custom errors as `error`, but I can see why it would confuse someone.
- echlebek 8y agoTotes.
- deleted 8y ago[deleted]