
Better Error Handling, in Go - HtmlGravity
https://bet365techblog.com/better-error-handling-in-go
======
creatornator
This is such an elegant solution, I'm surprised I don't see it recommended
more! I never would have thought to use defer to clean up the error catching
noise.

~~~
Insanity
I think the structure as they show it in the end does not survive formatting
though.

    
    
         if err != nil { return }
    

would get turned into

    
    
         if err != nil {
              return
         }
    

By gofmt. So if you want your code to be well formatted, you still get some
visual polution from the error handling there.

