Re:Upcoming Features in Go 1.18
by lalaithion on Tuesday November 09, 2021 @12:29PM
(#29164567)
I don't actually mind writing the above and adding context, but let's brainstorm some syntax that does the same thing without being verbose. How about something like:
which is automatically desugared to
[ Parent
| on HN ]
> let's brainstorm some syntax
Don't forget to check if someone else already had the same idea: https://seankhliao.com/blog/12020-11-23-go-error-handling-pr...
Re:Upcoming Features in Go 1.18
by lalaithion on Tuesday November 09, 2021 @12:44PM
(#29164782)
The try syntax proposed there and in other places returns the error unwrapped, which is a no-go for me. I wrap every error that I return from every function.
Oh can I see how you do it?
Please share articles/blog posts!
I would guess there are newer articles about best practices for Go error handling, other than the great articles by Dave Cheney.
https://dave.cheney.net/2016/04/27/dont-just-check-errors-ha...