3 ms·
Go's error handling is only a problem because of other missing features...algebraic types and/or generics. With either of those features, you could implement tw
by curun1r 12y ago
Go's error handling is only a problem because of other missing features...algebraic types and/or generics. With either of those features, you could implement two-track, functional composition with a single bind method. That would go a long way towards only having to write your "if err != nil" once rather than once per function invocation.
Alas, the lack of those other features leads to articles like this one that offer unnatural ways of avoiding something that is pretty much idiomatic in the language.