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)
See for yourself: https://go.dev/play/p/Q7IPuPS5CwQ
https://cs.opensource.google/go/go/+/refs/tags/go1.24.3:src/...