Re:Rust vs. Go in 2023
by kaba0 on Sunday August 13, 2023 @04:47AM
(#37107936)
Which is the only sane thing in most cases. What can you do inside the helper function of a helper function with an incorrect user data? The only sane place to handle it is n levels up, so bubbling up is the correct default. At least rust has a handy macro for it, but go’s error handling is catastrophic, not a proper sum type, nor some form of propagation… it is literally the bad errno from C burned into the language.
[ Parent
| on HN ]
Re:Rust vs. Go in 2023
by Aditya_Garg on Sunday August 13, 2023 @12:41PM
(#37111551)
In go, you should manually propagate the errors up by returning them. At the n levels up, you handle the error. It's a bit cumbersome during write time but a life saver during read/debug time.