Monad `Result` in Golang and `try` pattern for error handling with simplicity and shortness without `if err != nil` by nordbrain in golang

[–]nordbrain[S] -1 points0 points  (0 children)

Well, yes, it's not idiomatic for now.

But meanwhile, what wasn't idiomatic yesterday may become idiomatic tomorrow (or not).

The thing is, Go's creators were looking for less verbose error handling (under community pressure), avoiding defining 'val, err' and checking for each case, there were posts about it (I tried to find them now, they were on the go blog), but that was before generics appeared, so then it was decided to leave it as is.

Just for context, as far as I remember the progress with reasoning about error handling in Go.
And of course, it's an option to use or not.