News for hackers. Stuff that matters.
Re:(On | No) Syntactic Support for Error Handling by masklinn on Thursday June 05, 2025 @01:08AM (#44188474)
Of course it does. What do you think an errors.New contains and how do you figure it compares by value when checking placeholder errors?

The answer is that errors.New just wraps the error message in an errorString struct, and the second line of `is` is a string comparison.

Re:(On | No) Syntactic Support for Error Handling by kiitos on Friday June 06, 2025 @12:14PM (#44202340)
Re:(On | No) Syntactic Support for Error Handling by masklinn on Saturday June 07, 2025 @05:09AM (#44208429)
Oh hell, I always forget equality doesn't go through pointers in go, you're right.

And as you demonstrate I could have tested it easily enough to confirm I was reading the code correctly...