2 ms·
There is no need to have try-catch at every function invocation. One can do this only at the level at which one needs to handle the error. In Go, every call ma
by lenkite 3y ago
There is no need to have try-catch at every function invocation. One can do this only at the level at which one needs to handle the error.
In Go, every call made to a function is 5 statements and lines. Go code tends to bloat up the screen quite a bit and eyes glaze over.
result, err := f()
if err != nil {
return nil, err // I don't want to handle this here but at callers.caller.
}
return result