Seemingly unpopular opinion (with a lens of Go programming): Don't mock dependencies. It is brittle. Stub/fake with dependency injection. It is unimportant that a function was called N times with arguments foo and bar. What is important is that unit tests validate that units output what they should output (success and error cases) and that integration tests ensure things work together.