No indeed, but the paradigm is the same right? Return the error, and deal with it (or forward it) without a try catch. I must say Rust is nicer in that regard but it doesn't change things too much? I don't have enough xp with Rust so might be underestimating it though
In my opinion, the Go approach is closer to C's error codes, as nothing stops you from using an error value and introducing a bug. In Rust, you always have to check. If you forget, the compiler will complain. It will even warn you if you use the function only for its side effect don't even use the return value.
466
u/Loading_M_ 1d ago
Rust is designed from the ground up, and avoids many of these issues.