News for hackers. Stuff that matters.
Re:Go Run by lenkite on Thursday February 22, 2024 @08:16AM (#39466576)
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

There are no comments on this comment yet.