diff --git a/gomock/example_test.go b/gomock/example_test.go index 994ec43..6051b71 100644 --- a/gomock/example_test.go +++ b/gomock/example_test.go @@ -12,6 +12,7 @@ import ( type Foo interface { Bar(string) string + String() string } func ExampleCall_DoAndReturn_latency() { diff --git a/gomock/internal/mock_gomock/mock_matcher.go b/gomock/internal/mock_gomock/mock_matcher.go index bf3cc1e..fb0693c 100644 --- a/gomock/internal/mock_gomock/mock_matcher.go +++ b/gomock/internal/mock_gomock/mock_matcher.go @@ -38,6 +38,11 @@ func (m *MockMatcher) EXPECT() *MockMatcherMockRecorder { return m.recorder } +// ISGOMOCK indicates that this struct is a gomock mock. +func (m *MockMatcher) ISGOMOCK() struct{} { + return struct{}{} +} + // Matches mocks base method. func (m *MockMatcher) Matches(arg0 any) bool { m.ctrl.T.Helper() diff --git a/mockgen/internal/tests/add_generate_directive/mock.go b/mockgen/internal/tests/add_generate_directive/mock.go index 9c9098d..1594548 100644 --- a/mockgen/internal/tests/add_generate_directive/mock.go +++ b/mockgen/internal/tests/add_generate_directive/mock.go @@ -40,6 +40,11 @@ func (m *MockFoo) EXPECT() *MockFooMockRecorder { return m.recorder } +// ISGOMOCK indicates that this struct is a gomock mock. +func (m *MockFoo) ISGOMOCK() struct{} { + return struct{}{} +} + // Bar mocks base method. func (m *MockFoo) Bar(arg0 []string, arg1 chan<- Message) { m.ctrl.T.Helper() diff --git a/mockgen/internal/tests/const_array_length/mock.go b/mockgen/internal/tests/const_array_length/mock.go index bd71ca9..844a9ab 100644 --- a/mockgen/internal/tests/const_array_length/mock.go +++ b/mockgen/internal/tests/const_array_length/mock.go @@ -38,6 +38,11 @@ func (m *MockI) EXPECT() *MockIMockRecorder { return m.recorder } +// ISGOMOCK indicates that this struct is a gomock mock. +func (m *MockI) ISGOMOCK() struct{} { + return struct{}{} +} + // Bar mocks base method. func (m *MockI) Bar() [2]int { m.ctrl.T.Helper() diff --git a/mockgen/internal/tests/copyright_file/mock.go b/mockgen/internal/tests/copyright_file/mock.go index 65fd79c..cd71bea 100644 --- a/mockgen/internal/tests/copyright_file/mock.go +++ b/mockgen/internal/tests/copyright_file/mock.go @@ -42,3 +42,8 @@ func NewMockEmpty(ctrl *gomock.Controller) *MockEmpty { func (m *MockEmpty) EXPECT() *MockEmptyMockRecorder { return m.recorder } + +// ISGOMOCK indicates that this struct is a gomock mock. +func (m *MockEmpty) ISGOMOCK() struct{} { + return struct{}{} +} diff --git a/mockgen/internal/tests/custom_package_name/greeter/greeter_mock_test.go b/mockgen/internal/tests/custom_package_name/greeter/greeter_mock_test.go index e54593b..1eaa93c 100644 --- a/mockgen/internal/tests/custom_package_name/greeter/greeter_mock_test.go +++ b/mockgen/internal/tests/custom_package_name/greeter/greeter_mock_test.go @@ -39,6 +39,11 @@ func (m *MockInputMaker) EXPECT() *MockInputMakerMockRecorder { return m.recorder } +// ISGOMOCK indicates that this struct is a gomock mock. +func (m *MockInputMaker) ISGOMOCK() struct{} { + return struct{}{} +} + // MakeInput mocks base method. func (m *MockInputMaker) MakeInput() client.GreetInput { m.ctrl.T.Helper() diff --git a/mockgen/internal/tests/defined_import_local_name/mock.go b/mockgen/internal/tests/defined_import_local_name/mock.go index ca9577a..9648c8f 100644 --- a/mockgen/internal/tests/defined_import_local_name/mock.go +++ b/mockgen/internal/tests/defined_import_local_name/mock.go @@ -40,6 +40,11 @@ func (m *MockWithImports) EXPECT() *MockWithImportsMockRecorder { return m.recorder } +// ISGOMOCK indicates that this struct is a gomock mock. +func (m *MockWithImports) ISGOMOCK() struct{} { + return struct{}{} +} + // Method1 mocks base method. func (m *MockWithImports) Method1() b_mock.Buffer { m.ctrl.T.Helper() diff --git a/mockgen/internal/tests/dot_imports/mock.go b/mockgen/internal/tests/dot_imports/mock.go index 4e9f67e..20d27d3 100644 --- a/mockgen/internal/tests/dot_imports/mock.go +++ b/mockgen/internal/tests/dot_imports/mock.go @@ -41,6 +41,11 @@ func (m *MockWithDotImports) EXPECT() *MockWithDotImportsMockRecorder { return m.recorder } +// ISGOMOCK indicates that this struct is a gomock mock. +func (m *MockWithDotImports) ISGOMOCK() struct{} { + return struct{}{} +} + // Method1 mocks base method. func (m *MockWithDotImports) Method1() Request { m.ctrl.T.Helper() diff --git a/mockgen/internal/tests/empty_interface/mock.go b/mockgen/internal/tests/empty_interface/mock.go index b19c4b2..6656e40 100644 --- a/mockgen/internal/tests/empty_interface/mock.go +++ b/mockgen/internal/tests/empty_interface/mock.go @@ -35,3 +35,8 @@ func NewMockEmpty(ctrl *gomock.Controller) *MockEmpty { func (m *MockEmpty) EXPECT() *MockEmptyMockRecorder { return m.recorder } + +// ISGOMOCK indicates that this struct is a gomock mock. +func (m *MockEmpty) ISGOMOCK() struct{} { + return struct{}{} +} diff --git a/mockgen/internal/tests/exclude/mock.go b/mockgen/internal/tests/exclude/mock.go index f13a92a..4f219ae 100644 --- a/mockgen/internal/tests/exclude/mock.go +++ b/mockgen/internal/tests/exclude/mock.go @@ -38,6 +38,11 @@ func (m *MockGenerateMockForMe) EXPECT() *MockGenerateMockForMeMockRecorder { return m.recorder } +// ISGOMOCK indicates that this struct is a gomock mock. +func (m *MockGenerateMockForMe) ISGOMOCK() struct{} { + return struct{}{} +} + // B mocks base method. func (m *MockGenerateMockForMe) B() int { m.ctrl.T.Helper() diff --git a/mockgen/internal/tests/extra_import/mock.go b/mockgen/internal/tests/extra_import/mock.go index b730cd3..1c3173c 100644 --- a/mockgen/internal/tests/extra_import/mock.go +++ b/mockgen/internal/tests/extra_import/mock.go @@ -38,6 +38,11 @@ func (m *MockFoo) EXPECT() *MockFooMockRecorder { return m.recorder } +// ISGOMOCK indicates that this struct is a gomock mock. +func (m *MockFoo) ISGOMOCK() struct{} { + return struct{}{} +} + // Bar mocks base method. func (m *MockFoo) Bar(arg0 []string, arg1 chan<- Message) { m.ctrl.T.Helper() diff --git a/mockgen/internal/tests/generated_identifier_conflict/bugreport_mock.go b/mockgen/internal/tests/generated_identifier_conflict/bugreport_mock.go index c66a763..cf871e1 100644 --- a/mockgen/internal/tests/generated_identifier_conflict/bugreport_mock.go +++ b/mockgen/internal/tests/generated_identifier_conflict/bugreport_mock.go @@ -38,6 +38,11 @@ func (m *MockExample) EXPECT() *MockExampleMockRecorder { return m.recorder } +// ISGOMOCK indicates that this struct is a gomock mock. +func (m *MockExample) ISGOMOCK() struct{} { + return struct{}{} +} + // Method mocks base method. func (m_2 *MockExample) Method(_m, _mr, m, mr int) { m_2.ctrl.T.Helper() diff --git a/mockgen/internal/tests/import_embedded_interface/bugreport_mock.go b/mockgen/internal/tests/import_embedded_interface/bugreport_mock.go index f0b9d84..5564c86 100644 --- a/mockgen/internal/tests/import_embedded_interface/bugreport_mock.go +++ b/mockgen/internal/tests/import_embedded_interface/bugreport_mock.go @@ -40,6 +40,11 @@ func (m *MockSource) EXPECT() *MockSourceMockRecorder { return m.recorder } +// ISGOMOCK indicates that this struct is a gomock mock. +func (m *MockSource) ISGOMOCK() struct{} { + return struct{}{} +} + // Bar mocks base method. func (m *MockSource) Bar() Baz { m.ctrl.T.Helper() diff --git a/mockgen/internal/tests/import_embedded_interface/net_mock.go b/mockgen/internal/tests/import_embedded_interface/net_mock.go index 8831f62..1f7ba06 100644 --- a/mockgen/internal/tests/import_embedded_interface/net_mock.go +++ b/mockgen/internal/tests/import_embedded_interface/net_mock.go @@ -39,6 +39,11 @@ func (m *MockNet) EXPECT() *MockNetMockRecorder { return m.recorder } +// ISGOMOCK indicates that this struct is a gomock mock. +func (m *MockNet) ISGOMOCK() struct{} { + return struct{}{} +} + // Header mocks base method. func (m *MockNet) Header() http.Header { m.ctrl.T.Helper() diff --git a/mockgen/internal/tests/import_source/definition/source_mock.go b/mockgen/internal/tests/import_source/definition/source_mock.go index 783c5a5..318544a 100644 --- a/mockgen/internal/tests/import_source/definition/source_mock.go +++ b/mockgen/internal/tests/import_source/definition/source_mock.go @@ -38,6 +38,11 @@ func (m *MockS) EXPECT() *MockSMockRecorder { return m.recorder } +// ISGOMOCK indicates that this struct is a gomock mock. +func (m *MockS) ISGOMOCK() struct{} { + return struct{}{} +} + // F mocks base method. func (m *MockS) F(arg0 X) { m.ctrl.T.Helper() diff --git a/mockgen/internal/tests/import_source/source_mock.go b/mockgen/internal/tests/import_source/source_mock.go index 740dcfa..7605f4a 100644 --- a/mockgen/internal/tests/import_source/source_mock.go +++ b/mockgen/internal/tests/import_source/source_mock.go @@ -39,6 +39,11 @@ func (m *MockS) EXPECT() *MockSMockRecorder { return m.recorder } +// ISGOMOCK indicates that this struct is a gomock mock. +func (m *MockS) ISGOMOCK() struct{} { + return struct{}{} +} + // F mocks base method. func (m *MockS) F(arg0 source.X) { m.ctrl.T.Helper() diff --git a/mockgen/internal/tests/internal_pkg/subdir/internal/pkg/source_output/mock.go b/mockgen/internal/tests/internal_pkg/subdir/internal/pkg/source_output/mock.go index 016f1e2..0f841bf 100644 --- a/mockgen/internal/tests/internal_pkg/subdir/internal/pkg/source_output/mock.go +++ b/mockgen/internal/tests/internal_pkg/subdir/internal/pkg/source_output/mock.go @@ -39,6 +39,11 @@ func (m *MockArg) EXPECT() *MockArgMockRecorder { return m.recorder } +// ISGOMOCK indicates that this struct is a gomock mock. +func (m *MockArg) ISGOMOCK() struct{} { + return struct{}{} +} + // Foo mocks base method. func (m *MockArg) Foo() int { m.ctrl.T.Helper() @@ -76,6 +81,11 @@ func (m *MockIntf) EXPECT() *MockIntfMockRecorder { return m.recorder } +// ISGOMOCK indicates that this struct is a gomock mock. +func (m *MockIntf) ISGOMOCK() struct{} { + return struct{}{} +} + // F mocks base method. func (m *MockIntf) F() pkg.Arg { m.ctrl.T.Helper() diff --git a/mockgen/internal/tests/missing_import/output/source_mock.go b/mockgen/internal/tests/missing_import/output/source_mock.go index 4fb6542..7f20a99 100644 --- a/mockgen/internal/tests/missing_import/output/source_mock.go +++ b/mockgen/internal/tests/missing_import/output/source_mock.go @@ -39,6 +39,11 @@ func (m *MockBar) EXPECT() *MockBarMockRecorder { return m.recorder } +// ISGOMOCK indicates that this struct is a gomock mock. +func (m *MockBar) ISGOMOCK() struct{} { + return struct{}{} +} + // Baz mocks base method. func (m *MockBar) Baz(arg0 source.Foo) { m.ctrl.T.Helper() diff --git a/mockgen/internal/tests/mock_in_test_package/mock_test.go b/mockgen/internal/tests/mock_in_test_package/mock_test.go index be55b03..6b187d8 100644 --- a/mockgen/internal/tests/mock_in_test_package/mock_test.go +++ b/mockgen/internal/tests/mock_in_test_package/mock_test.go @@ -39,6 +39,11 @@ func (m *MockFinder) EXPECT() *MockFinderMockRecorder { return m.recorder } +// ISGOMOCK indicates that this struct is a gomock mock. +func (m *MockFinder) ISGOMOCK() struct{} { + return struct{}{} +} + // Add mocks base method. func (m *MockFinder) Add(u users.User) { m.ctrl.T.Helper() diff --git a/mockgen/internal/tests/mock_name/mocks/post_service.go b/mockgen/internal/tests/mock_name/mocks/post_service.go index dc49918..d1dcc6d 100644 --- a/mockgen/internal/tests/mock_name/mocks/post_service.go +++ b/mockgen/internal/tests/mock_name/mocks/post_service.go @@ -40,6 +40,11 @@ func (m *PostServiceMock) EXPECT() *PostServiceMockMockRecorder { return m.recorder } +// ISGOMOCK indicates that this struct is a gomock mock. +func (m *PostServiceMock) ISGOMOCK() struct{} { + return struct{}{} +} + // Create mocks base method. func (m *PostServiceMock) Create(arg0, arg1 string, arg2 *user.User) (*post.Post, error) { m.ctrl.T.Helper() diff --git a/mockgen/internal/tests/mock_name/mocks/user_service.go b/mockgen/internal/tests/mock_name/mocks/user_service.go index db5b35e..8842eae 100644 --- a/mockgen/internal/tests/mock_name/mocks/user_service.go +++ b/mockgen/internal/tests/mock_name/mocks/user_service.go @@ -39,6 +39,11 @@ func (m *UserServiceMock) EXPECT() *UserServiceMockMockRecorder { return m.recorder } +// ISGOMOCK indicates that this struct is a gomock mock. +func (m *UserServiceMock) ISGOMOCK() struct{} { + return struct{}{} +} + // Create mocks base method. func (m *UserServiceMock) Create(arg0 string) (*user.User, error) { m.ctrl.T.Helper() diff --git a/mockgen/internal/tests/overlapping_methods/mock.go b/mockgen/internal/tests/overlapping_methods/mock.go index 139c15e..2cd0751 100644 --- a/mockgen/internal/tests/overlapping_methods/mock.go +++ b/mockgen/internal/tests/overlapping_methods/mock.go @@ -38,6 +38,11 @@ func (m *MockReadWriteCloser) EXPECT() *MockReadWriteCloserMockRecorder { return m.recorder } +// ISGOMOCK indicates that this struct is a gomock mock. +func (m *MockReadWriteCloser) ISGOMOCK() struct{} { + return struct{}{} +} + // Close mocks base method. func (m *MockReadWriteCloser) Close() error { m.ctrl.T.Helper() diff --git a/mockgen/internal/tests/panicing_test/mock_test.go b/mockgen/internal/tests/panicing_test/mock_test.go index ebdbd72..42e5fae 100644 --- a/mockgen/internal/tests/panicing_test/mock_test.go +++ b/mockgen/internal/tests/panicing_test/mock_test.go @@ -38,6 +38,11 @@ func (m *MockFoo) EXPECT() *MockFooMockRecorder { return m.recorder } +// ISGOMOCK indicates that this struct is a gomock mock. +func (m *MockFoo) ISGOMOCK() struct{} { + return struct{}{} +} + // Bar mocks base method. func (m *MockFoo) Bar() string { m.ctrl.T.Helper() diff --git a/mockgen/internal/tests/sanitization/mockout/mock.go b/mockgen/internal/tests/sanitization/mockout/mock.go index a529b2d..8e130b9 100644 --- a/mockgen/internal/tests/sanitization/mockout/mock.go +++ b/mockgen/internal/tests/sanitization/mockout/mock.go @@ -39,6 +39,11 @@ func (m *MockAnyMock) EXPECT() *MockAnyMockMockRecorder { return m.recorder } +// ISGOMOCK indicates that this struct is a gomock mock. +func (m *MockAnyMock) ISGOMOCK() struct{} { + return struct{}{} +} + // Do mocks base method. func (m *MockAnyMock) Do(arg0 *any0.Any, arg1 int) { m.ctrl.T.Helper() diff --git a/mockgen/internal/tests/self_package/mock.go b/mockgen/internal/tests/self_package/mock.go index dc322b0..18494fa 100644 --- a/mockgen/internal/tests/self_package/mock.go +++ b/mockgen/internal/tests/self_package/mock.go @@ -38,6 +38,11 @@ func (m *MockMethods) EXPECT() *MockMethodsMockRecorder { return m.recorder } +// ISGOMOCK indicates that this struct is a gomock mock. +func (m *MockMethods) ISGOMOCK() struct{} { + return struct{}{} +} + // getInfo mocks base method. func (m *MockMethods) getInfo() Info { m.ctrl.T.Helper() diff --git a/mockgen/internal/tests/test_package/mock_test.go b/mockgen/internal/tests/test_package/mock_test.go index 364f94d..e0a5a0d 100644 --- a/mockgen/internal/tests/test_package/mock_test.go +++ b/mockgen/internal/tests/test_package/mock_test.go @@ -38,6 +38,11 @@ func (m *MockFinder) EXPECT() *MockFinderMockRecorder { return m.recorder } +// ISGOMOCK indicates that this struct is a gomock mock. +func (m *MockFinder) ISGOMOCK() struct{} { + return struct{}{} +} + // Add mocks base method. func (m *MockFinder) Add(u User) { m.ctrl.T.Helper() diff --git a/mockgen/internal/tests/typed_inorder/mock.go b/mockgen/internal/tests/typed_inorder/mock.go index 97301a9..ff98128 100644 --- a/mockgen/internal/tests/typed_inorder/mock.go +++ b/mockgen/internal/tests/typed_inorder/mock.go @@ -38,6 +38,11 @@ func (m *MockAnimal) EXPECT() *MockAnimalMockRecorder { return m.recorder } +// ISGOMOCK indicates that this struct is a gomock mock. +func (m *MockAnimal) ISGOMOCK() struct{} { + return struct{}{} +} + // Feed mocks base method. func (m *MockAnimal) Feed(arg0 string) error { m.ctrl.T.Helper() diff --git a/mockgen/internal/tests/unexported_method/bugreport_mock.go b/mockgen/internal/tests/unexported_method/bugreport_mock.go index 0f11c48..8cb2e03 100644 --- a/mockgen/internal/tests/unexported_method/bugreport_mock.go +++ b/mockgen/internal/tests/unexported_method/bugreport_mock.go @@ -38,6 +38,11 @@ func (m *MockExample) EXPECT() *MockExampleMockRecorder { return m.recorder } +// ISGOMOCK indicates that this struct is a gomock mock. +func (m *MockExample) ISGOMOCK() struct{} { + return struct{}{} +} + // someMethod mocks base method. func (m *MockExample) someMethod(arg0 string) string { m.ctrl.T.Helper() diff --git a/mockgen/internal/tests/vendor_dep/mock.go b/mockgen/internal/tests/vendor_dep/mock.go index 7862124..7ce6fd4 100644 --- a/mockgen/internal/tests/vendor_dep/mock.go +++ b/mockgen/internal/tests/vendor_dep/mock.go @@ -39,6 +39,11 @@ func (m *MockVendorsDep) EXPECT() *MockVendorsDepMockRecorder { return m.recorder } +// ISGOMOCK indicates that this struct is a gomock mock. +func (m *MockVendorsDep) ISGOMOCK() struct{} { + return struct{}{} +} + // Foo mocks base method. func (m *MockVendorsDep) Foo() present.Elem { m.ctrl.T.Helper() diff --git a/mockgen/internal/tests/vendor_dep/source_mock_package/mock.go b/mockgen/internal/tests/vendor_dep/source_mock_package/mock.go index 8092c70..b55394a 100644 --- a/mockgen/internal/tests/vendor_dep/source_mock_package/mock.go +++ b/mockgen/internal/tests/vendor_dep/source_mock_package/mock.go @@ -39,6 +39,11 @@ func (m *MockVendorsDep) EXPECT() *MockVendorsDepMockRecorder { return m.recorder } +// ISGOMOCK indicates that this struct is a gomock mock. +func (m *MockVendorsDep) ISGOMOCK() struct{} { + return struct{}{} +} + // Foo mocks base method. func (m *MockVendorsDep) Foo() present.Elem { m.ctrl.T.Helper() diff --git a/mockgen/internal/tests/vendor_pkg/mock.go b/mockgen/internal/tests/vendor_pkg/mock.go index 6276ec1..10eb886 100644 --- a/mockgen/internal/tests/vendor_pkg/mock.go +++ b/mockgen/internal/tests/vendor_pkg/mock.go @@ -38,6 +38,11 @@ func (m *MockElem) EXPECT() *MockElemMockRecorder { return m.recorder } +// ISGOMOCK indicates that this struct is a gomock mock. +func (m *MockElem) ISGOMOCK() struct{} { + return struct{}{} +} + // TemplateName mocks base method. func (m *MockElem) TemplateName() string { m.ctrl.T.Helper() diff --git a/sample/concurrent/mock/concurrent_mock.go b/sample/concurrent/mock/concurrent_mock.go index b397185..cc74e54 100644 --- a/sample/concurrent/mock/concurrent_mock.go +++ b/sample/concurrent/mock/concurrent_mock.go @@ -38,6 +38,11 @@ func (m *MockMath) EXPECT() *MockMathMockRecorder { return m.recorder } +// ISGOMOCK indicates that this struct is a gomock mock. +func (m *MockMath) ISGOMOCK() struct{} { + return struct{}{} +} + // Sum mocks base method. func (m *MockMath) Sum(arg0, arg1 int) int { m.ctrl.T.Helper() diff --git a/sample/mock_user_test.go b/sample/mock_user_test.go index f5f3e69..4025a9d 100644 --- a/sample/mock_user_test.go +++ b/sample/mock_user_test.go @@ -49,6 +49,11 @@ func (m *MockIndex) EXPECT() *MockIndexMockRecorder { return m.recorder } +// ISGOMOCK indicates that this struct is a gomock mock. +func (m *MockIndex) ISGOMOCK() struct{} { + return struct{}{} +} + // Anon mocks base method. func (m *MockIndex) Anon(arg0 string) { m.ctrl.T.Helper() @@ -358,6 +363,11 @@ func (m *MockEmbed) EXPECT() *MockEmbedMockRecorder { return m.recorder } +// ISGOMOCK indicates that this struct is a gomock mock. +func (m *MockEmbed) ISGOMOCK() struct{} { + return struct{}{} +} + // EmbeddedMethod mocks base method. func (m *MockEmbed) EmbeddedMethod() { m.ctrl.T.Helper() @@ -431,6 +441,11 @@ func (m *MockEmbedded) EXPECT() *MockEmbeddedMockRecorder { return m.recorder } +// ISGOMOCK indicates that this struct is a gomock mock. +func (m *MockEmbedded) ISGOMOCK() struct{} { + return struct{}{} +} + // EmbeddedMethod mocks base method. func (m *MockEmbedded) EmbeddedMethod() { m.ctrl.T.Helper()