Unit test (UT) test the alogrithm and logic per module. In this tutorial, use gomock and mockgen to do UT.
git clone https://github.com/ChantYuCN/utpractice.git utp && cd utp
make dependence
vi pkg/hello.go
make mockprepare
vi pkg/hello_test.go
make test
make clean