Hi Jan, thanks for response. On Mon, 5 Jun 2023 01:06:37 -0700 (PDT) Jan <pfei...@gmail.com> wrote:
> Repeating Justin's consideration: one of my (and from colleagues I > discuss the topic with) major issues with current error handling is > the repetition of identical code. Your proposal still requires `when > err handle ...` at every statement. Yes, correct. The idea is not to minimise repetition on error handling statement, the "if err != nil", but to minimise repetitive error handling body by grouping it into single handle based on the context of error. > It also doesn't allow for nested > call of functions that return errors -- e.g: `f(g(h(x)))`, where `h`, > `g`, and `f` can return errors (all presumably handled the same way). > I am not sure I understand this, but should not each function handle it on its own? Or should not `f` being called if `g` return an error? If its later, yes, it does not allow for nested handling of error. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/20230617142140.48f4d12c%40inspiro.localdomain.
pgp6EUFAPyDPr.pgp
Description: OpenPGP digital signature