4 ms·
I think this is fine. 90% of the code that starts with "if err != nil" is immediately followed by "return nil, err". Of course this obscures the origin of the e
by rollcat 3y ago
I think this is fine. 90% of the code that starts with "if err != nil" is immediately followed by "return nil, err". Of course this obscures the origin of the error, but that's probably a fundamental problem with not having automatic stack unwinding. (Maybe unary "Foo()?" could "return nil, err", but infix "Foo()?NewErr" would do "return nil, errors.Join(err, NewErr)"... but that starts to look like line noise...)