News for hackers. Stuff that matters.
Re:Go’ing Insane: Endless Error Handling by josephg on Tuesday September 14, 2021 @09:02AM (#28524095)
Like Go, the error is just returned from the function. The Result<> type is literally defined as “either an error value or a success value”.

It’s up to the caller what to do with an error - panic, return it in turn, wrap it, or whatever else makes sense in context. It’s semantically quite similar to Go - except with better library support (Result instead of returning a tuple) and better syntax (the “?” operator instead of manual checks).

There are no comments on this comment yet.