Errors are Values
The Go Blog
It’s an oldie, but I always go back to it. The post I keep sending to people who tell me Go error handling is just noise. The point was never that you type if err != nil a lot. The point is that an error is an ordinary value, so you can do ordinary things with it.