4 ms·
With some effort, it can be made less horrible. I have a utility function that lets me write it like this, whenever I can get away with doing steps after an err
by richard_todd 10y ago
With some effort, it can be made less horrible. I have a utility function that lets me write it like this, whenever I can get away with doing steps after an error has occurred:
a, err1 := foo()
b, err2 := bar()
c, err3 := baz()
return a+b+c, errs.Combine(err1,err2,err3)
- jonathankoren 10y agoYeah that kinda works, except you have to make sure that you add your error code to the end every time you add something. Also, you're still stuck with doing the check if your code doesn't quit hit this pattern.