> I agree that Go should really have an analogue to Rust's `?`, but you can't really do that in a sane way without sum types to represent your conditions. The very multiple-return style error propagation makes it impractical to do.
There is always the Odin style 'or_return' operator, which is defined for a similar situation.
What is quite interesting (after looking at their documentation), is that V lang[1] has all that is mentioned: `?`[2], `or`[2], sum types[3], and can return multiple values[4].
There is always the Odin style 'or_return' operator, which is defined for a similar situation.
https://odin-lang.org/docs/overview/#or_return-operator