Introduction
In the previous chapter, we learned how to reduce, reuse, and recycle good code practices with Go through the help of functions, separating logical components, and more! We also discovered more regarding functions, such as the fact that functions can be passed as parameters and returned from a function. In this chapter, we will work with errors and learn how to return those from functions.
Developers are not perfect and, by extension, neither is the code that they produce. All software at some point in time has had errors. Handling errors is critical when you are developing software. These errors can have a negative impact of varying degrees on its users. The impact on the users of your software can be more far-reaching than you realize.
For instance, let’s consider the Northeast Blackout of 2003. On August 14, there was a blackout for about 50 million people in the United States and Canada that lasted for 14 days. This was due to a race condition bug in the...