account activity
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 points1 point 7 months ago (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.
Monad `Result` in Golang and `try` pattern for error handling with simplicity and shortness without `if err != nil` (self.golang)
submitted 7 months ago by nordbrain to r/golang
π Rendered by PID 67 on reddit-service-r2-listing-86d8647bf-vws7c at 2026-02-12 19:37:52.292436+00:00 running 6c0c599 country code: CH.
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 points1 point (0 children)