News for hackers. Stuff that matters.
Re:Structured Errors in Go by atombender on Tuesday June 03, 2025 @04:24PM (#44174320)
That is just your opinion. There is absolutely nothing wrong with doing so, and there is nothing in the documentation that asserts what you claim.

The documentation is clear that comparing an error value or casting it without following the Unwrap() chain is only an antipattern because it would not work with wrapped errors.

Is() and As() are merely convenience functions, and the documentation is clear that all they're doing is calling Unwrap(), which you can do yourself.

Re:Structured Errors in Go by kiitos on Wednesday June 04, 2025 @01:36AM (#44177533)
It literally is not. Is and As are not merely convenience functions, they're canonical and conventional expectations of Go code, if you're doing that work yourself you're almost certainly doing it wrong.