How to Use Mock Testing in Go
Mocking & Rocking - Power Up Your Go Testing.
In this tutorial, we will use mock testing to improve the testing process in Go. We will talk about how to use mockgen to generate mock objects, and cover a few advanced techniques like mocking functions with interfaces, using testify/mock to simplify mock testing, mocking HTTP requests with httptest, etc.
Unit testing in Go is easy!
The Power of Unit Testing in Your Go Projects.
Prerequisites
Software Requirements - What You Need to Know Before You Begin.
Setting Up the Demo Project in GoLand
Unleash the Power of Mocks - Build a Project from Scratch.
More Mocking Techniques
Mocking Power - Interfaces, Testify, and HTTP for Go Testing.
Conclusion
Where to Go from Here.