One of the building blocks of the testing process in any piece of software is known as unit testing. Unit testing is a very popular concept in virtually any programming language, and there are numerous software frameworks and language extensions that allow you to perform unit testing as efficiently as possible.
The idea of unit testing is to test each unit or component of your software separately. A unit can simply be defined as the smallest testable piece of your software.
The Go language comes equipped with a testing package, as well as some Go commands to make the process of unit testing easier. The package can be found at https://golang.org/pkg/testing/.
In this section, we'll dive a bit deeper into how to build unit tests in the Go language. However, before we start writing unit tests in Go, we first need to cover the concept of mocking.
...