2 ms·
The standard is usually if err != nil { return (whatever null type), err } The error will propagate up, since all calls to a function returnin
by RBerenguel 12y ago
The standard is usually
if err != nil {
return (whatever null type), err
}
The error will propagate up, since all calls to a function returning err should be checking for the err. In a not-so-ideal world, just return err up. In a relatively more sane world, you can send "up" extra information along the error (just creating a new error with extra info) to know the error path. The first caller will/should handle this error then.