I realize it is probably too late to change this behavior, but I still think it is worthwhile flagging a bug I found recently. if you have already declared err in your scope (happens frequently), the following code can return nil on an error condition
err := doSomething()
if err != nil {
return stacktrace.Propagate(err, "")
}
...
for _, whatever := range things {
if whatever {
return nil, stacktrace.Propagate(err,"this is supposed to be an error condition")
}
}
...
the loss is not being able to do compact single-line returns, which is arguably poor go style anyways
I realize it is probably too late to change this behavior, but I still think it is worthwhile flagging a bug I found recently. if you have already declared err in your scope (happens frequently), the following code can return nil on an error condition
the loss is not being able to do compact single-line returns, which is arguably poor go style anyways