← Back to context

Comment by moltonel

8 hours 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.h...), not just `Result<T,E>`.

Returning an error to the caller in Rust can be done with a single character.