Using Go Mocks in Unit Tests
- Add following line into the .go file that the interface(s) are defined:
//go:generate mamockgen interface_name1 [interface_name2 ...]
- Run 'go generate .' and gazelle in the directory to generate the mocks code and BUILD.bazel
- The package of the generated mocks code will be the original package name + mocks. For example, the mocks code generated from api/interfaces.go is in package "github.com/michelangelo-ai/michelangelo/go/api/apimocks"
- commit the generated mocks code to git repo