Summary

This chapter provided a broad introduction to the practice of writing tests in Go. It discussed several key topics, including the use of the go test tool to compile and execute automated tests. Readers learned how to write test functions to ensure their code is properly tested and covered. The chapter also discussed the topic of testing HTTP clients and servers. Finally, the chapter introduced the topic of benchmarking as a way to automate, analyze, and measure code performance using built-in Go tools.

Get Go: Design Patterns for Real-World Projects 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.