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:
committed by
Lucas Bremgartner
parent
c4521bcc9d
commit
b21592468b
@@ -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) {
|
||||
|
Reference in New Issue
Block a user