Use error decorators to simplify your error handling code
March 28, 2023
In the last week, I’ve helped two different clients solve the same problem. So I decided to make a video about the technique.
Imagine you’ve written a Retry function that accepts a callback function as an argument, and executes it in a loop until success. Now further imagine that some errors should not be retried. Learn how to use a simple custom error type implimentation as a decorator type, to simplify this type of logic.
What is the Best Book to Learn Go in 2023?
After reading every beginner's book I could find on Go, here is my recommended #1 book to help you learn the language.
JSON Tricks: Extending an Embedded Marshaler
How can you embed a struct with a custom MarshalJSON() method?
Improve your knowledge of Go