News for hackers. Stuff that matters.
Re:Eris – A better way to handle, trace, and log errors in Go by tsimionescu on Thursday December 26, 2019 @12:05PM (#21885122)
What I meant about abstraction is that if you define a function which returns an error struct instead of an error interface, you lose any abstraction capability, you can only return that specific struct (and need to find some way of signaling that no error occurred).
Re:Eris – A better way to handle, trace, and log errors in Go by weberc2 on Thursday December 26, 2019 @05:02PM (#21887208)
Ah, I see. Yes, that’s true. You would need to return a bool alongside it or similar, but the best practice is to use an interface for sure.