Add static interface implementation check

Add an additional line of code per interface to the generated mock file,
which allows the go compiler to statically check if the mock implements
the mocked interface.
This commit is contained in:
Lucas Bremgartner
2018-06-04 14:22:28 +02:00
committed by Lucas Bremgartner
parent c4521bcc9d
commit b21592468b
9 changed files with 93 additions and 4 deletions

View File

@@ -13,6 +13,10 @@ var (
lockMyInterfaceMockTwo sync.RWMutex
)
// Ensure, that MyInterfaceMock does implement MyInterface.
// If this is not the case, regenerate this file with moq.
var _ MyInterface = &MyInterfaceMock{}
// MyInterfaceMock is a mock implementation of MyInterface.
//
// func TestSomethingThatUsesMyInterface(t *testing.T) {