News for hackers. Stuff that matters.
Re:Down the Golang Nil Rabbit Hole by tsimionescu on Tuesday March 30, 2021 @05:30AM (#26632640)
Most errors in Go are still just strings, potentially with some comparison possible witht sentinel values like in the "io" package. As and Is give some nice tools, but its still up to documentation to decide which one to use, and different packages have different conventions for returning error types vs error values.
Re:Down the Golang Nil Rabbit Hole by saturn_vk on Tuesday March 30, 2021 @06:36AM (#26633008)
Most errors are probably strings since there probably is nothing you can customize as a handling for such particular error types. Now, if one could do something with a certain error class, then such error are usually not strings.