Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
packetlost
on Oct 19, 2023
|
parent
|
context
|
favorite
| on:
Banging errors in Go
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
on Oct 20, 2023
[–]
like Zigs `try xyz();` which does what you say
packetlost
on Oct 20, 2023
|
parent
[–]
Or Rust's `?`. The problem is Go returns errors by conventional multiple-returns/tuples, not by language construct.
lionkor
on Oct 20, 2023
|
root
|
parent
[–]
it could do something sane but smart, like returning the error for whatever argument is an error type, and nil the rest.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: