Mocking With Go Interfaces
Go's implicit interfaces provide great flexibility when it comes to testing our applications. By satisfying the expected contract we can create mocks easily to be used within our test cases. For me there are two main approaches I personally take to mocking.
Lightweight Mocking I call this lightweight as it is less involved than the method we will come onto next. It basically involves just creating a new structure which satisfies the interface.
2020-03-13