> But where they really shine, like in the mapping example, isn't possible in Go.
oh yeah, definitely! Go's version of EaV with multiple returns is pretty lackluster compared to a proper Result type. afaict it's kind of "the worst of both worlds" -- all of the boilerplate of plumbing errors manually w/ none of the benefits.
Re:Go 1.18
by kevinmgranger on Wednesday March 16, 2022 @11:59AM
(#30700444)
Folks are saying that sum types might eventually come to go after some experimenting with generics. It'll be interesting to see where it goes.
Returning errors makes many things more manageable, definitely. But where they really shine, like in the mapping example, isn't possible in Go. Unless I'm mistaken with how go generics work.
(By the way, I'm a huge fan of how error handling works in Rust and other related functional languages. Definitely not advocating for the classic way of doing Exceptions).