The first pattern does not do that. The second one is still mostly pointless generic boilerplate:
blah, err :=
if err != nil {
return nil, errors.New()
}
is all boilerplate, only two parts are not: the call itself and the error message.> An exception and line-number (and a call-stack dump) is great for a developer, but a good textual error message is needed for a real user.
1. having exceptions doesn't preclude handling them and writing user-readable error messages
2. exceptions are not the only alternative to C-style error handling