3 ms·
Go funcs can return both a value and an error, or neither, it's a common gotcha. Having to check the behavior each time is no fun. Missing error handling is ch
by moltonel 4mo ago
Go funcs can return both a value and an error, or neither, it's a common gotcha. Having to check the behavior each time is no fun.
Missing error handling is checked at compile-time in Rust (lint-time in Go), and can be enabled for any struct or function (https://doc.rust-lang.org/reference/attributes/diagnostics.html#the-must_use-attribute https://doc.rust-lang.org/reference/attributes/diagnostics.h...), not just `Result<T,E>`.
Returning an error to the caller in Rust can be done with a single character.