Re:Rust vs Go: A Hands-On Comparison
by mariusor on Wednesday September 27, 2023 @02:57PM
(#37679512)
Only one of the calls in the block is an actual irrecoverable error that you should propagate up to the parent caller.
If you just append if err != nil blocks everywhere without reasoning about the context you're probably doing it wrong.
No, it isn't necessary. Most go projects implement error handling functions, so you only have single error lines:
Handle(err)
Re:Rust vs Go: A Hands-On Comparison
by badrequest on Tuesday October 03, 2023 @05:32PM
(#37757851)
If those calls can cause errors, then yes, it's necessary to handle them. Maybe you're content to have a contextless stack trace printed whenever things fail, but I like a little order.
Like take a look at this pattern:
Is it really necessary to have the error handling explicit in this case? Go through any of your go code. I find this kind of error handling is 90% of the error handling I write.