4 ms·
In Rust it's guaranteed that you never get both Ok and Err values at the same time (Result is a tagged union, not a tuple). In golang both are independent, and
by pornel 6y ago
In Rust it's guaranteed that you never get both Ok and Err values at the same time (Result is a tagged union, not a tuple).
In golang both are independent, and it's unclear whether you can or should use the ok value when err != nil. There are some interfaces that actually return both at the same time.
- coldtea 6y ago>In Rust it's guaranteed that you never get both Ok and Err values at the same time (Result is a tagged union, not a tuple). Yeah, that's the standardized part -- it's a tagged union. In Goland the second value might not even be an error, it's just a convention using the variadic return capabilities...