Summary
In this chapter, we studied various methodologies for easing the debugging process such as coding incrementally and testing the code often, writing unit tests, handling all errors, and performing logging on the code.
Looking at the fmt
package, we discovered various ways to output information to help us to find bugs. The fmt
package offered different print formatting, verbs, and ways to control the output of verbs by the use of various flags.
With the usage of logging from Go’s standard library, we were able to see details of how our application was executed. The log
package allowed us to see the file path and line number on which the log event took place. The log
package came with various print functions that mimic some of the fmt
print functions, which provided us with various insights into the usage of the verbs we learned in this chapter. We were able to perform basic debugging by using the standard library that is provided by Go. We looked at the log
package...