3 ms·
I also like errors as values, I just wish there was a syntactically simpler way to express "let the caller of this function deal with the error".
by packetlost 3y ago
I also like errors as values, I just wish there was a syntactically simpler way to express "let the caller of this function deal with the error".
- lionkor 3y agolike Zigs `try xyz();` which does what you say
- packetlost 3y agoOr Rust's `?`. The problem is Go returns errors by conventional multiple-returns/tuples, not by language construct.
- lionkor 3y agoit could do something sane but smart, like returning the error for whatever argument is an error type, and nil the rest.