Go errors with codes
In a hurry 🏃? Jump to the conclusion After some discussion on Reddit, I decided to write this blog post on how to have Go errors containing codes you can use in calling layers. This is the case for example if you want to have the HTTP status code contained in an error created in your database package. Let’s start with some base code showing how this works. You have two files:...