© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2022
A. FreemanPro Gohttps://doi.org/10.1007/978-1-4842-7355-5_31

31. Unit Testing, Benchmarking, and Logging

Adam Freeman1  
(1)
London, UK
 
In this chapter, I finish describing the most useful standard library packages with unit testing, benchmarking, and logging. The logging features are fine, if a little basic, and there are plenty of third-party packages available for directing log messages to different destinations. The testing and benchmarking features are integrated into the go command, but, as I explain, I am not enthusiastic about either feature. Table 31-1 summarizes the chapter.
Table 31-1

Chapter Summary

Problem

Solution

Listing

Create a unit test

Add a file ...

Get Pro Go: The Complete Guide to Programming Reliable and Efficient Software Using Golang now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.