From 2c0a7fd3fd16005190aec5f0400031d8a048419d Mon Sep 17 00:00:00 2001 From: Matthias Fasching <5011972+fasmat@users.noreply.github.com> Date: Wed, 10 Jul 2024 05:27:11 +0200 Subject: [PATCH] chore: upgrade go versions and fix ci test execution (#187) I updated the CI to use the two newest stable versions of go (v1.21.x and v1.22.x) to test the code as well as the oldest version (`v1.19.x`) that could still be used to build the source. The behaviour of the `go version` line in `go.mod` changed with `v1.21.x`: it should state the oldest version of go that is needed to build the source. The source builds and tests fine with `v1.19.x`, older versions however fail, so I set it to this version. Before my changes the `test` GH workflow didn't actually execute `./ci/test.sh` because there is was check that skipped testing if the used go version was any other than `1.18`. I removed this check which showed some tests failing even without my changes. The issue turned out to have been introduced by accident (because tests weren't executed) in https://github.com/uber-go/mock/pull/48. The fix for it can be found in commit https://github.com/uber-go/mock/pull/187/commits/0403497b4ea38317a8cbf0fb30c122f4dc60bdb4 (part of this PR). Additionally I had to regenerate all mocks or `./ci/tests.sh` would complain that they weren't up to date. --- .github/workflows/release.yaml | 2 +- .github/workflows/test.yaml | 5 +- ci/test.sh | 4 - go.mod | 6 +- go.sum | 9 +- mockgen/internal/tests/generics/go.mod | 8 +- mockgen/internal/tests/generics/go.sum | 4 +- .../generics/source/mock_external_mock.go | 25 ++ .../generics/source/mock_generics_mock.go | 30 ++ .../internal/tests/typed/bugreport_mock.go | 38 ++- mockgen/internal/tests/typed/faux/faux.go | 4 +- mockgen/internal/tests/typed/go.mod | 4 +- mockgen/internal/tests/typed/go.sum | 4 +- .../tests/typed/source/mock_external_test.go | 150 +++++---- .../tests/typed/source/mock_generics_test.go | 299 +++++++++--------- tools/go.mod | 2 +- 16 files changed, 325 insertions(+), 269 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 5a58641..45a411b 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -20,7 +20,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v4 with: - go-version: 1.20.x + go-version: 1.22.x - name: Prepare release run: | diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 38a26a1..0776fef 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -8,14 +8,11 @@ on: permissions: contents: read -env: - GO111MODULE: on - jobs: test: strategy: matrix: - go-version: [1.19.x, 1.20.x] + go-version: [1.19.x, 1.21.x, 1.22.x] # oldest version that can build go mock and official supported go versions os: [ubuntu-latest] runs-on: ${{ matrix.os }} steps: diff --git a/ci/test.sh b/ci/test.sh index 8e57f4e..27092bd 100755 --- a/ci/test.sh +++ b/ci/test.sh @@ -3,10 +3,6 @@ set -euo pipefail -if [[ $(go version) != *"go1.18"* ]]; then - exit 0 -fi - for i in $(find $PWD -name go.mod); do pushd $(dirname $i) go mod tidy diff --git a/go.mod b/go.mod index 4826710..9bc7fad 100644 --- a/go.mod +++ b/go.mod @@ -1,10 +1,10 @@ module go.uber.org/mock -go 1.20 +go 1.19 require ( - golang.org/x/mod v0.15.0 - golang.org/x/tools v0.18.0 + golang.org/x/mod v0.18.0 + golang.org/x/tools v0.22.0 ) require github.com/yuin/goldmark v1.4.13 // indirect diff --git a/go.sum b/go.sum index b9d67d8..00a4009 100644 --- a/go.sum +++ b/go.sum @@ -1,6 +1,7 @@ github.com/yuin/goldmark v1.4.13 h1:fVcFKWvrslecOb/tg+Cc05dkeYx540o0FuFt3nUVDoE= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8= -golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/tools v0.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ= -golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg= +golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0= +golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= +golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= diff --git a/mockgen/internal/tests/generics/go.mod b/mockgen/internal/tests/generics/go.mod index 0122445..cffe722 100644 --- a/mockgen/internal/tests/generics/go.mod +++ b/mockgen/internal/tests/generics/go.mod @@ -2,9 +2,9 @@ module go.uber.org/mock/mockgen/internal/tests/generics go 1.19 +replace go.uber.org/mock => ../../../.. + require ( - go.uber.org/mock v1.6.0 - golang.org/x/exp v0.0.0-20220428152302-39d4317da171 + go.uber.org/mock v0.0.0-00010101000000-000000000000 + golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 ) - -replace go.uber.org/mock => ../../../.. diff --git a/mockgen/internal/tests/generics/go.sum b/mockgen/internal/tests/generics/go.sum index 698ce9b..dcd770d 100644 --- a/mockgen/internal/tests/generics/go.sum +++ b/mockgen/internal/tests/generics/go.sum @@ -1,2 +1,2 @@ -golang.org/x/exp v0.0.0-20220428152302-39d4317da171 h1:TfdoLivD44QwvssI9Sv1xwa5DcL5XQr4au4sZ2F2NV4= -golang.org/x/exp v0.0.0-20220428152302-39d4317da171/go.mod h1:lgLbSvA5ygNOMpwM/9anMpWVlVJ7Z+cHWq/eFuinpGE= +golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 h1:yixxcjnhBmY0nkL253HFVIm0JsFHwrHdT3Yh6szTnfY= +golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8/go.mod h1:jj3sYF3dwk5D+ghuXyeI3r5MFf+NT2An6/9dOA95KSI= diff --git a/mockgen/internal/tests/generics/source/mock_external_mock.go b/mockgen/internal/tests/generics/source/mock_external_mock.go index 7e3700f..20df447 100644 --- a/mockgen/internal/tests/generics/source/mock_external_mock.go +++ b/mockgen/internal/tests/generics/source/mock_external_mock.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: external.go +// +// Generated by this command: +// +// mockgen --source=external.go --destination=source/mock_external_mock.go --package source +// // Package source is a generated GoMock package. package source @@ -37,6 +42,11 @@ func (m *MockExternalConstraint[I, F]) EXPECT() *MockExternalConstraintMockRecor return m.recorder } +// ISGOMOCK indicates that this struct is a gomock mock. +func (m *MockExternalConstraint[I, F]) ISGOMOCK() struct{} { + return struct{}{} +} + // Eight mocks base method. func (m *MockExternalConstraint[I, F]) Eight(arg0 F) other.Two[I, F] { m.ctrl.T.Helper() @@ -242,6 +252,11 @@ func (m *MockEmbeddingIface[T, R]) EXPECT() *MockEmbeddingIfaceMockRecorder[T, R return m.recorder } +// ISGOMOCK indicates that this struct is a gomock mock. +func (m *MockEmbeddingIface[T, R]) ISGOMOCK() struct{} { + return struct{}{} +} + // Eight mocks base method. func (m *MockEmbeddingIface[T, R]) Eight(arg0 R) other.Two[T, R] { m.ctrl.T.Helper() @@ -546,6 +561,11 @@ func (m *MockGenerator[T]) EXPECT() *MockGeneratorMockRecorder[T] { return m.recorder } +// ISGOMOCK indicates that this struct is a gomock mock. +func (m *MockGenerator[T]) ISGOMOCK() struct{} { + return struct{}{} +} + // Generate mocks base method. func (m *MockGenerator[T]) Generate() T { m.ctrl.T.Helper() @@ -583,6 +603,11 @@ func (m *MockGroup[T]) EXPECT() *MockGroupMockRecorder[T] { return m.recorder } +// ISGOMOCK indicates that this struct is a gomock mock. +func (m *MockGroup[T]) ISGOMOCK() struct{} { + return struct{}{} +} + // Join mocks base method. func (m *MockGroup[T]) Join(ctx context.Context) []T { m.ctrl.T.Helper() diff --git a/mockgen/internal/tests/generics/source/mock_generics_mock.go b/mockgen/internal/tests/generics/source/mock_generics_mock.go index 8953118..39c331b 100644 --- a/mockgen/internal/tests/generics/source/mock_generics_mock.go +++ b/mockgen/internal/tests/generics/source/mock_generics_mock.go @@ -41,6 +41,11 @@ func (m *MockBar[T, R]) EXPECT() *MockBarMockRecorder[T, R] { return m.recorder } +// ISGOMOCK indicates that this struct is a gomock mock. +func (m *MockBar[T, R]) ISGOMOCK() struct{} { + return struct{}{} +} + // Eight mocks base method. func (m *MockBar[T, R]) Eight(arg0 T) other.Two[T, R] { m.ctrl.T.Helper() @@ -334,6 +339,11 @@ func (m *MockUniverse[T]) EXPECT() *MockUniverseMockRecorder[T] { return m.recorder } +// ISGOMOCK indicates that this struct is a gomock mock. +func (m *MockUniverse[T]) ISGOMOCK() struct{} { + return struct{}{} +} + // Water mocks base method. func (m *MockUniverse[T]) Water(arg0 T) []T { m.ctrl.T.Helper() @@ -371,6 +381,11 @@ func (m *MockMilkyWay[R]) EXPECT() *MockMilkyWayMockRecorder[R] { return m.recorder } +// ISGOMOCK indicates that this struct is a gomock mock. +func (m *MockMilkyWay[R]) ISGOMOCK() struct{} { + return struct{}{} +} + // Water mocks base method. func (m *MockMilkyWay[R]) Water(arg0 R) []R { m.ctrl.T.Helper() @@ -408,6 +423,11 @@ func (m *MockSolarSystem[T]) EXPECT() *MockSolarSystemMockRecorder[T] { return m.recorder } +// ISGOMOCK indicates that this struct is a gomock mock. +func (m *MockSolarSystem[T]) ISGOMOCK() struct{} { + return struct{}{} +} + // Water mocks base method. func (m *MockSolarSystem[T]) Water(arg0 T) []T { m.ctrl.T.Helper() @@ -445,6 +465,11 @@ func (m *MockEarth[R]) EXPECT() *MockEarthMockRecorder[R] { return m.recorder } +// ISGOMOCK indicates that this struct is a gomock mock. +func (m *MockEarth[R]) ISGOMOCK() struct{} { + return struct{}{} +} + // Water mocks base method. func (m *MockEarth[R]) Water(arg0 R) []R { m.ctrl.T.Helper() @@ -482,6 +507,11 @@ func (m *MockWater[R, C]) EXPECT() *MockWaterMockRecorder[R, C] { return m.recorder } +// ISGOMOCK indicates that this struct is a gomock mock. +func (m *MockWater[R, C]) ISGOMOCK() struct{} { + return struct{}{} +} + // Fish mocks base method. func (m *MockWater[R, C]) Fish(arg0 R) []C { m.ctrl.T.Helper() diff --git a/mockgen/internal/tests/typed/bugreport_mock.go b/mockgen/internal/tests/typed/bugreport_mock.go index 3eba52a..00589b1 100644 --- a/mockgen/internal/tests/typed/bugreport_mock.go +++ b/mockgen/internal/tests/typed/bugreport_mock.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: bugreport.go +// +// Generated by this command: +// +// mockgen -typed -aux_files faux=faux/faux.go -destination bugreport_mock.go -package typed -source=bugreport.go Example +// // Package typed is a generated GoMock package. package typed @@ -34,6 +39,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{}{} +} + // Error mocks base method. func (m *MockSource) Error() string { m.ctrl.T.Helper() @@ -43,31 +53,31 @@ func (m *MockSource) Error() string { } // Error indicates an expected call of Error. -func (mr *MockSourceMockRecorder) Error() *SourceErrorCall { +func (mr *MockSourceMockRecorder) Error() *MockSourceErrorCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Error", reflect.TypeOf((*MockSource)(nil).Error)) - return &SourceErrorCall{Call: call} + return &MockSourceErrorCall{Call: call} } -// SourceErrorCall wrap *gomock.Call -type SourceErrorCall struct { +// MockSourceErrorCall wrap *gomock.Call +type MockSourceErrorCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *SourceErrorCall) Return(arg0 string) *SourceErrorCall { +func (c *MockSourceErrorCall) Return(arg0 string) *MockSourceErrorCall { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *SourceErrorCall) Do(f func() string) *SourceErrorCall { +func (c *MockSourceErrorCall) Do(f func() string) *MockSourceErrorCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *SourceErrorCall) DoAndReturn(f func() string) *SourceErrorCall { +func (c *MockSourceErrorCall) DoAndReturn(f func() string) *MockSourceErrorCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -81,31 +91,31 @@ func (m *MockSource) Method() faux.Return { } // Method indicates an expected call of Method. -func (mr *MockSourceMockRecorder) Method() *SourceMethodCall { +func (mr *MockSourceMockRecorder) Method() *MockSourceMethodCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Method", reflect.TypeOf((*MockSource)(nil).Method)) - return &SourceMethodCall{Call: call} + return &MockSourceMethodCall{Call: call} } -// SourceMethodCall wrap *gomock.Call -type SourceMethodCall struct { +// MockSourceMethodCall wrap *gomock.Call +type MockSourceMethodCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *SourceMethodCall) Return(arg0 faux.Return) *SourceMethodCall { +func (c *MockSourceMethodCall) Return(arg0 faux.Return) *MockSourceMethodCall { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *SourceMethodCall) Do(f func() faux.Return) *SourceMethodCall { +func (c *MockSourceMethodCall) Do(f func() faux.Return) *MockSourceMethodCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *SourceMethodCall) DoAndReturn(f func() faux.Return) *SourceMethodCall { +func (c *MockSourceMethodCall) DoAndReturn(f func() faux.Return) *MockSourceMethodCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/mockgen/internal/tests/typed/faux/faux.go b/mockgen/internal/tests/typed/faux/faux.go index fdd9c5f..00f795e 100644 --- a/mockgen/internal/tests/typed/faux/faux.go +++ b/mockgen/internal/tests/typed/faux/faux.go @@ -6,6 +6,6 @@ type Foreign interface { error } -type Embedded any +type Embedded interface{} -type Return any +type Return interface{} diff --git a/mockgen/internal/tests/typed/go.mod b/mockgen/internal/tests/typed/go.mod index 831bf3b..67403cf 100644 --- a/mockgen/internal/tests/typed/go.mod +++ b/mockgen/internal/tests/typed/go.mod @@ -1,10 +1,10 @@ module go.uber.org/mock/mockgen/internal/tests/typed -go 1.18 +go 1.19 replace go.uber.org/mock => ../../../.. require ( go.uber.org/mock v0.0.0-00010101000000-000000000000 - golang.org/x/exp v0.0.0-20220609121020-a51bd0440498 + golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 ) diff --git a/mockgen/internal/tests/typed/go.sum b/mockgen/internal/tests/typed/go.sum index 43a2583..dcd770d 100644 --- a/mockgen/internal/tests/typed/go.sum +++ b/mockgen/internal/tests/typed/go.sum @@ -1,2 +1,2 @@ -golang.org/x/exp v0.0.0-20220609121020-a51bd0440498 h1:TF0FvLUGEq/8wOt/9AV1nj6D4ViZGUIGCMQfCv7VRXY= -golang.org/x/exp v0.0.0-20220609121020-a51bd0440498/go.mod h1:yh0Ynu2b5ZUe3MQfp2nM0ecK7wsgouWTDN0FNeJuIys= +golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 h1:yixxcjnhBmY0nkL253HFVIm0JsFHwrHdT3Yh6szTnfY= +golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8/go.mod h1:jj3sYF3dwk5D+ghuXyeI3r5MFf+NT2An6/9dOA95KSI= diff --git a/mockgen/internal/tests/typed/source/mock_external_test.go b/mockgen/internal/tests/typed/source/mock_external_test.go index 0f92d35..f74c930 100644 --- a/mockgen/internal/tests/typed/source/mock_external_test.go +++ b/mockgen/internal/tests/typed/source/mock_external_test.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: external.go +// +// Generated by this command: +// +// mockgen --source=external.go --destination=source/mock_external_test.go --package source -typed +// // Package source is a generated GoMock package. package source @@ -36,6 +41,11 @@ func (m *MockExternalConstraint[I, F]) EXPECT() *MockExternalConstraintMockRecor return m.recorder } +// ISGOMOCK indicates that this struct is a gomock mock. +func (m *MockExternalConstraint[I, F]) ISGOMOCK() struct{} { + return struct{}{} +} + // Eight mocks base method. func (m *MockExternalConstraint[I, F]) Eight(arg0 F) other.Two[I, F] { m.ctrl.T.Helper() @@ -45,31 +55,31 @@ func (m *MockExternalConstraint[I, F]) Eight(arg0 F) other.Two[I, F] { } // Eight indicates an expected call of Eight. -func (mr *MockExternalConstraintMockRecorder[I, F]) Eight(arg0 any) *ExternalConstraintEightCall[I, F] { +func (mr *MockExternalConstraintMockRecorder[I, F]) Eight(arg0 any) *MockExternalConstraintEightCall[I, F] { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Eight", reflect.TypeOf((*MockExternalConstraint[I, F])(nil).Eight), arg0) - return &ExternalConstraintEightCall[I, F]{Call: call} + return &MockExternalConstraintEightCall[I, F]{Call: call} } -// ExternalConstraintEightCall wrap *gomock.Call -type ExternalConstraintEightCall[I constraints.Integer, F constraints.Float] struct { +// MockExternalConstraintEightCall wrap *gomock.Call +type MockExternalConstraintEightCall[I constraints.Integer, F constraints.Float] struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *ExternalConstraintEightCall[I, F]) Return(arg0 other.Two[I, F]) *ExternalConstraintEightCall[I, F] { +func (c *MockExternalConstraintEightCall[I, F]) Return(arg0 other.Two[I, F]) *MockExternalConstraintEightCall[I, F] { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *ExternalConstraintEightCall[I, F]) Do(f func(F) other.Two[I, F]) *ExternalConstraintEightCall[I, F] { +func (c *MockExternalConstraintEightCall[I, F]) Do(f func(F) other.Two[I, F]) *MockExternalConstraintEightCall[I, F] { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *ExternalConstraintEightCall[I, F]) DoAndReturn(f func(F) other.Two[I, F]) *ExternalConstraintEightCall[I, F] { +func (c *MockExternalConstraintEightCall[I, F]) DoAndReturn(f func(F) other.Two[I, F]) *MockExternalConstraintEightCall[I, F] { c.Call = c.Call.DoAndReturn(f) return c } @@ -83,31 +93,31 @@ func (m *MockExternalConstraint[I, F]) Five(arg0 I) typed.Baz[F] { } // Five indicates an expected call of Five. -func (mr *MockExternalConstraintMockRecorder[I, F]) Five(arg0 any) *ExternalConstraintFiveCall[I, F] { +func (mr *MockExternalConstraintMockRecorder[I, F]) Five(arg0 any) *MockExternalConstraintFiveCall[I, F] { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Five", reflect.TypeOf((*MockExternalConstraint[I, F])(nil).Five), arg0) - return &ExternalConstraintFiveCall[I, F]{Call: call} + return &MockExternalConstraintFiveCall[I, F]{Call: call} } -// ExternalConstraintFiveCall wrap *gomock.Call -type ExternalConstraintFiveCall[I constraints.Integer, F constraints.Float] struct { +// MockExternalConstraintFiveCall wrap *gomock.Call +type MockExternalConstraintFiveCall[I constraints.Integer, F constraints.Float] struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *ExternalConstraintFiveCall[I, F]) Return(arg0 typed.Baz[F]) *ExternalConstraintFiveCall[I, F] { +func (c *MockExternalConstraintFiveCall[I, F]) Return(arg0 typed.Baz[F]) *MockExternalConstraintFiveCall[I, F] { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *ExternalConstraintFiveCall[I, F]) Do(f func(I) typed.Baz[F]) *ExternalConstraintFiveCall[I, F] { +func (c *MockExternalConstraintFiveCall[I, F]) Do(f func(I) typed.Baz[F]) *MockExternalConstraintFiveCall[I, F] { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *ExternalConstraintFiveCall[I, F]) DoAndReturn(f func(I) typed.Baz[F]) *ExternalConstraintFiveCall[I, F] { +func (c *MockExternalConstraintFiveCall[I, F]) DoAndReturn(f func(I) typed.Baz[F]) *MockExternalConstraintFiveCall[I, F] { c.Call = c.Call.DoAndReturn(f) return c } @@ -121,31 +131,31 @@ func (m *MockExternalConstraint[I, F]) Four(arg0 I) typed.Foo[I, F] { } // Four indicates an expected call of Four. -func (mr *MockExternalConstraintMockRecorder[I, F]) Four(arg0 any) *ExternalConstraintFourCall[I, F] { +func (mr *MockExternalConstraintMockRecorder[I, F]) Four(arg0 any) *MockExternalConstraintFourCall[I, F] { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Four", reflect.TypeOf((*MockExternalConstraint[I, F])(nil).Four), arg0) - return &ExternalConstraintFourCall[I, F]{Call: call} + return &MockExternalConstraintFourCall[I, F]{Call: call} } -// ExternalConstraintFourCall wrap *gomock.Call -type ExternalConstraintFourCall[I constraints.Integer, F constraints.Float] struct { +// MockExternalConstraintFourCall wrap *gomock.Call +type MockExternalConstraintFourCall[I constraints.Integer, F constraints.Float] struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *ExternalConstraintFourCall[I, F]) Return(arg0 typed.Foo[I, F]) *ExternalConstraintFourCall[I, F] { +func (c *MockExternalConstraintFourCall[I, F]) Return(arg0 typed.Foo[I, F]) *MockExternalConstraintFourCall[I, F] { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *ExternalConstraintFourCall[I, F]) Do(f func(I) typed.Foo[I, F]) *ExternalConstraintFourCall[I, F] { +func (c *MockExternalConstraintFourCall[I, F]) Do(f func(I) typed.Foo[I, F]) *MockExternalConstraintFourCall[I, F] { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *ExternalConstraintFourCall[I, F]) DoAndReturn(f func(I) typed.Foo[I, F]) *ExternalConstraintFourCall[I, F] { +func (c *MockExternalConstraintFourCall[I, F]) DoAndReturn(f func(I) typed.Foo[I, F]) *MockExternalConstraintFourCall[I, F] { c.Call = c.Call.DoAndReturn(f) return c } @@ -157,31 +167,31 @@ func (m *MockExternalConstraint[I, F]) Nine(arg0 typed.Iface[I]) { } // Nine indicates an expected call of Nine. -func (mr *MockExternalConstraintMockRecorder[I, F]) Nine(arg0 any) *ExternalConstraintNineCall[I, F] { +func (mr *MockExternalConstraintMockRecorder[I, F]) Nine(arg0 any) *MockExternalConstraintNineCall[I, F] { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Nine", reflect.TypeOf((*MockExternalConstraint[I, F])(nil).Nine), arg0) - return &ExternalConstraintNineCall[I, F]{Call: call} + return &MockExternalConstraintNineCall[I, F]{Call: call} } -// ExternalConstraintNineCall wrap *gomock.Call -type ExternalConstraintNineCall[I constraints.Integer, F constraints.Float] struct { +// MockExternalConstraintNineCall wrap *gomock.Call +type MockExternalConstraintNineCall[I constraints.Integer, F constraints.Float] struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *ExternalConstraintNineCall[I, F]) Return() *ExternalConstraintNineCall[I, F] { +func (c *MockExternalConstraintNineCall[I, F]) Return() *MockExternalConstraintNineCall[I, F] { c.Call = c.Call.Return() return c } // Do rewrite *gomock.Call.Do -func (c *ExternalConstraintNineCall[I, F]) Do(f func(typed.Iface[I])) *ExternalConstraintNineCall[I, F] { +func (c *MockExternalConstraintNineCall[I, F]) Do(f func(typed.Iface[I])) *MockExternalConstraintNineCall[I, F] { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *ExternalConstraintNineCall[I, F]) DoAndReturn(f func(typed.Iface[I])) *ExternalConstraintNineCall[I, F] { +func (c *MockExternalConstraintNineCall[I, F]) DoAndReturn(f func(typed.Iface[I])) *MockExternalConstraintNineCall[I, F] { c.Call = c.Call.DoAndReturn(f) return c } @@ -195,31 +205,31 @@ func (m *MockExternalConstraint[I, F]) One(arg0 string) string { } // One indicates an expected call of One. -func (mr *MockExternalConstraintMockRecorder[I, F]) One(arg0 any) *ExternalConstraintOneCall[I, F] { +func (mr *MockExternalConstraintMockRecorder[I, F]) One(arg0 any) *MockExternalConstraintOneCall[I, F] { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "One", reflect.TypeOf((*MockExternalConstraint[I, F])(nil).One), arg0) - return &ExternalConstraintOneCall[I, F]{Call: call} + return &MockExternalConstraintOneCall[I, F]{Call: call} } -// ExternalConstraintOneCall wrap *gomock.Call -type ExternalConstraintOneCall[I constraints.Integer, F constraints.Float] struct { +// MockExternalConstraintOneCall wrap *gomock.Call +type MockExternalConstraintOneCall[I constraints.Integer, F constraints.Float] struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *ExternalConstraintOneCall[I, F]) Return(arg0 string) *ExternalConstraintOneCall[I, F] { +func (c *MockExternalConstraintOneCall[I, F]) Return(arg0 string) *MockExternalConstraintOneCall[I, F] { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *ExternalConstraintOneCall[I, F]) Do(f func(string) string) *ExternalConstraintOneCall[I, F] { +func (c *MockExternalConstraintOneCall[I, F]) Do(f func(string) string) *MockExternalConstraintOneCall[I, F] { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *ExternalConstraintOneCall[I, F]) DoAndReturn(f func(string) string) *ExternalConstraintOneCall[I, F] { +func (c *MockExternalConstraintOneCall[I, F]) DoAndReturn(f func(string) string) *MockExternalConstraintOneCall[I, F] { c.Call = c.Call.DoAndReturn(f) return c } @@ -233,31 +243,31 @@ func (m *MockExternalConstraint[I, F]) Seven(arg0 I) other.One[I] { } // Seven indicates an expected call of Seven. -func (mr *MockExternalConstraintMockRecorder[I, F]) Seven(arg0 any) *ExternalConstraintSevenCall[I, F] { +func (mr *MockExternalConstraintMockRecorder[I, F]) Seven(arg0 any) *MockExternalConstraintSevenCall[I, F] { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Seven", reflect.TypeOf((*MockExternalConstraint[I, F])(nil).Seven), arg0) - return &ExternalConstraintSevenCall[I, F]{Call: call} + return &MockExternalConstraintSevenCall[I, F]{Call: call} } -// ExternalConstraintSevenCall wrap *gomock.Call -type ExternalConstraintSevenCall[I constraints.Integer, F constraints.Float] struct { +// MockExternalConstraintSevenCall wrap *gomock.Call +type MockExternalConstraintSevenCall[I constraints.Integer, F constraints.Float] struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *ExternalConstraintSevenCall[I, F]) Return(arg0 other.One[I]) *ExternalConstraintSevenCall[I, F] { +func (c *MockExternalConstraintSevenCall[I, F]) Return(arg0 other.One[I]) *MockExternalConstraintSevenCall[I, F] { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *ExternalConstraintSevenCall[I, F]) Do(f func(I) other.One[I]) *ExternalConstraintSevenCall[I, F] { +func (c *MockExternalConstraintSevenCall[I, F]) Do(f func(I) other.One[I]) *MockExternalConstraintSevenCall[I, F] { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *ExternalConstraintSevenCall[I, F]) DoAndReturn(f func(I) other.One[I]) *ExternalConstraintSevenCall[I, F] { +func (c *MockExternalConstraintSevenCall[I, F]) DoAndReturn(f func(I) other.One[I]) *MockExternalConstraintSevenCall[I, F] { c.Call = c.Call.DoAndReturn(f) return c } @@ -271,31 +281,31 @@ func (m *MockExternalConstraint[I, F]) Six(arg0 I) *typed.Baz[F] { } // Six indicates an expected call of Six. -func (mr *MockExternalConstraintMockRecorder[I, F]) Six(arg0 any) *ExternalConstraintSixCall[I, F] { +func (mr *MockExternalConstraintMockRecorder[I, F]) Six(arg0 any) *MockExternalConstraintSixCall[I, F] { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Six", reflect.TypeOf((*MockExternalConstraint[I, F])(nil).Six), arg0) - return &ExternalConstraintSixCall[I, F]{Call: call} + return &MockExternalConstraintSixCall[I, F]{Call: call} } -// ExternalConstraintSixCall wrap *gomock.Call -type ExternalConstraintSixCall[I constraints.Integer, F constraints.Float] struct { +// MockExternalConstraintSixCall wrap *gomock.Call +type MockExternalConstraintSixCall[I constraints.Integer, F constraints.Float] struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *ExternalConstraintSixCall[I, F]) Return(arg0 *typed.Baz[F]) *ExternalConstraintSixCall[I, F] { +func (c *MockExternalConstraintSixCall[I, F]) Return(arg0 *typed.Baz[F]) *MockExternalConstraintSixCall[I, F] { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *ExternalConstraintSixCall[I, F]) Do(f func(I) *typed.Baz[F]) *ExternalConstraintSixCall[I, F] { +func (c *MockExternalConstraintSixCall[I, F]) Do(f func(I) *typed.Baz[F]) *MockExternalConstraintSixCall[I, F] { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *ExternalConstraintSixCall[I, F]) DoAndReturn(f func(I) *typed.Baz[F]) *ExternalConstraintSixCall[I, F] { +func (c *MockExternalConstraintSixCall[I, F]) DoAndReturn(f func(I) *typed.Baz[F]) *MockExternalConstraintSixCall[I, F] { c.Call = c.Call.DoAndReturn(f) return c } @@ -307,31 +317,31 @@ func (m *MockExternalConstraint[I, F]) Ten(arg0 *I) { } // Ten indicates an expected call of Ten. -func (mr *MockExternalConstraintMockRecorder[I, F]) Ten(arg0 any) *ExternalConstraintTenCall[I, F] { +func (mr *MockExternalConstraintMockRecorder[I, F]) Ten(arg0 any) *MockExternalConstraintTenCall[I, F] { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Ten", reflect.TypeOf((*MockExternalConstraint[I, F])(nil).Ten), arg0) - return &ExternalConstraintTenCall[I, F]{Call: call} + return &MockExternalConstraintTenCall[I, F]{Call: call} } -// ExternalConstraintTenCall wrap *gomock.Call -type ExternalConstraintTenCall[I constraints.Integer, F constraints.Float] struct { +// MockExternalConstraintTenCall wrap *gomock.Call +type MockExternalConstraintTenCall[I constraints.Integer, F constraints.Float] struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *ExternalConstraintTenCall[I, F]) Return() *ExternalConstraintTenCall[I, F] { +func (c *MockExternalConstraintTenCall[I, F]) Return() *MockExternalConstraintTenCall[I, F] { c.Call = c.Call.Return() return c } // Do rewrite *gomock.Call.Do -func (c *ExternalConstraintTenCall[I, F]) Do(f func(*I)) *ExternalConstraintTenCall[I, F] { +func (c *MockExternalConstraintTenCall[I, F]) Do(f func(*I)) *MockExternalConstraintTenCall[I, F] { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *ExternalConstraintTenCall[I, F]) DoAndReturn(f func(*I)) *ExternalConstraintTenCall[I, F] { +func (c *MockExternalConstraintTenCall[I, F]) DoAndReturn(f func(*I)) *MockExternalConstraintTenCall[I, F] { c.Call = c.Call.DoAndReturn(f) return c } @@ -345,31 +355,31 @@ func (m *MockExternalConstraint[I, F]) Three(arg0 I) F { } // Three indicates an expected call of Three. -func (mr *MockExternalConstraintMockRecorder[I, F]) Three(arg0 any) *ExternalConstraintThreeCall[I, F] { +func (mr *MockExternalConstraintMockRecorder[I, F]) Three(arg0 any) *MockExternalConstraintThreeCall[I, F] { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Three", reflect.TypeOf((*MockExternalConstraint[I, F])(nil).Three), arg0) - return &ExternalConstraintThreeCall[I, F]{Call: call} + return &MockExternalConstraintThreeCall[I, F]{Call: call} } -// ExternalConstraintThreeCall wrap *gomock.Call -type ExternalConstraintThreeCall[I constraints.Integer, F constraints.Float] struct { +// MockExternalConstraintThreeCall wrap *gomock.Call +type MockExternalConstraintThreeCall[I constraints.Integer, F constraints.Float] struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *ExternalConstraintThreeCall[I, F]) Return(arg0 F) *ExternalConstraintThreeCall[I, F] { +func (c *MockExternalConstraintThreeCall[I, F]) Return(arg0 F) *MockExternalConstraintThreeCall[I, F] { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *ExternalConstraintThreeCall[I, F]) Do(f func(I) F) *ExternalConstraintThreeCall[I, F] { +func (c *MockExternalConstraintThreeCall[I, F]) Do(f func(I) F) *MockExternalConstraintThreeCall[I, F] { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *ExternalConstraintThreeCall[I, F]) DoAndReturn(f func(I) F) *ExternalConstraintThreeCall[I, F] { +func (c *MockExternalConstraintThreeCall[I, F]) DoAndReturn(f func(I) F) *MockExternalConstraintThreeCall[I, F] { c.Call = c.Call.DoAndReturn(f) return c } @@ -383,31 +393,31 @@ func (m *MockExternalConstraint[I, F]) Two(arg0 I) string { } // Two indicates an expected call of Two. -func (mr *MockExternalConstraintMockRecorder[I, F]) Two(arg0 any) *ExternalConstraintTwoCall[I, F] { +func (mr *MockExternalConstraintMockRecorder[I, F]) Two(arg0 any) *MockExternalConstraintTwoCall[I, F] { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Two", reflect.TypeOf((*MockExternalConstraint[I, F])(nil).Two), arg0) - return &ExternalConstraintTwoCall[I, F]{Call: call} + return &MockExternalConstraintTwoCall[I, F]{Call: call} } -// ExternalConstraintTwoCall wrap *gomock.Call -type ExternalConstraintTwoCall[I constraints.Integer, F constraints.Float] struct { +// MockExternalConstraintTwoCall wrap *gomock.Call +type MockExternalConstraintTwoCall[I constraints.Integer, F constraints.Float] struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *ExternalConstraintTwoCall[I, F]) Return(arg0 string) *ExternalConstraintTwoCall[I, F] { +func (c *MockExternalConstraintTwoCall[I, F]) Return(arg0 string) *MockExternalConstraintTwoCall[I, F] { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *ExternalConstraintTwoCall[I, F]) Do(f func(I) string) *ExternalConstraintTwoCall[I, F] { +func (c *MockExternalConstraintTwoCall[I, F]) Do(f func(I) string) *MockExternalConstraintTwoCall[I, F] { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *ExternalConstraintTwoCall[I, F]) DoAndReturn(f func(I) string) *ExternalConstraintTwoCall[I, F] { +func (c *MockExternalConstraintTwoCall[I, F]) DoAndReturn(f func(I) string) *MockExternalConstraintTwoCall[I, F] { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/mockgen/internal/tests/typed/source/mock_generics_test.go b/mockgen/internal/tests/typed/source/mock_generics_test.go index 5bfbccc..40352fe 100644 --- a/mockgen/internal/tests/typed/source/mock_generics_test.go +++ b/mockgen/internal/tests/typed/source/mock_generics_test.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: generics.go +// +// Generated by this command: +// +// mockgen --source=generics.go --destination=source/mock_generics_test.go --package source -typed +// // Package source is a generated GoMock package. package source @@ -35,6 +40,11 @@ func (m *MockBar[T, R]) EXPECT() *MockBarMockRecorder[T, R] { return m.recorder } +// ISGOMOCK indicates that this struct is a gomock mock. +func (m *MockBar[T, R]) ISGOMOCK() struct{} { + return struct{}{} +} + // Eight mocks base method. func (m *MockBar[T, R]) Eight(arg0 T) other.Two[T, R] { m.ctrl.T.Helper() @@ -44,31 +54,31 @@ func (m *MockBar[T, R]) Eight(arg0 T) other.Two[T, R] { } // Eight indicates an expected call of Eight. -func (mr *MockBarMockRecorder[T, R]) Eight(arg0 any) *BarEightCall[T, R] { +func (mr *MockBarMockRecorder[T, R]) Eight(arg0 any) *MockBarEightCall[T, R] { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Eight", reflect.TypeOf((*MockBar[T, R])(nil).Eight), arg0) - return &BarEightCall[T, R]{Call: call} + return &MockBarEightCall[T, R]{Call: call} } -// BarEightCall wrap *gomock.Call -type BarEightCall[T any, R any] struct { +// MockBarEightCall wrap *gomock.Call +type MockBarEightCall[T any, R any] struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *BarEightCall[T, R]) Return(arg0 other.Two[T, R]) *BarEightCall[T, R] { +func (c *MockBarEightCall[T, R]) Return(arg0 other.Two[T, R]) *MockBarEightCall[T, R] { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *BarEightCall[T, R]) Do(f func(T) other.Two[T, R]) *BarEightCall[T, R] { +func (c *MockBarEightCall[T, R]) Do(f func(T) other.Two[T, R]) *MockBarEightCall[T, R] { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *BarEightCall[T, R]) DoAndReturn(f func(T) other.Two[T, R]) *BarEightCall[T, R] { +func (c *MockBarEightCall[T, R]) DoAndReturn(f func(T) other.Two[T, R]) *MockBarEightCall[T, R] { c.Call = c.Call.DoAndReturn(f) return c } @@ -83,31 +93,31 @@ func (m *MockBar[T, R]) Eighteen() (typed.Iface[*other.Five], error) { } // Eighteen indicates an expected call of Eighteen. -func (mr *MockBarMockRecorder[T, R]) Eighteen() *BarEighteenCall[T, R] { +func (mr *MockBarMockRecorder[T, R]) Eighteen() *MockBarEighteenCall[T, R] { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Eighteen", reflect.TypeOf((*MockBar[T, R])(nil).Eighteen)) - return &BarEighteenCall[T, R]{Call: call} + return &MockBarEighteenCall[T, R]{Call: call} } -// BarEighteenCall wrap *gomock.Call -type BarEighteenCall[T any, R any] struct { +// MockBarEighteenCall wrap *gomock.Call +type MockBarEighteenCall[T any, R any] struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *BarEighteenCall[T, R]) Return(arg0 typed.Iface[*other.Five], arg1 error) *BarEighteenCall[T, R] { +func (c *MockBarEighteenCall[T, R]) Return(arg0 typed.Iface[*other.Five], arg1 error) *MockBarEighteenCall[T, R] { c.Call = c.Call.Return(arg0, arg1) return c } // Do rewrite *gomock.Call.Do -func (c *BarEighteenCall[T, R]) Do(f func() (typed.Iface[*other.Five], error)) *BarEighteenCall[T, R] { +func (c *MockBarEighteenCall[T, R]) Do(f func() (typed.Iface[*other.Five], error)) *MockBarEighteenCall[T, R] { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *BarEighteenCall[T, R]) DoAndReturn(f func() (typed.Iface[*other.Five], error)) *BarEighteenCall[T, R] { +func (c *MockBarEighteenCall[T, R]) DoAndReturn(f func() (typed.Iface[*other.Five], error)) *MockBarEighteenCall[T, R] { c.Call = c.Call.DoAndReturn(f) return c } @@ -122,31 +132,31 @@ func (m *MockBar[T, R]) Eleven() (*other.One[T], error) { } // Eleven indicates an expected call of Eleven. -func (mr *MockBarMockRecorder[T, R]) Eleven() *BarElevenCall[T, R] { +func (mr *MockBarMockRecorder[T, R]) Eleven() *MockBarElevenCall[T, R] { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Eleven", reflect.TypeOf((*MockBar[T, R])(nil).Eleven)) - return &BarElevenCall[T, R]{Call: call} + return &MockBarElevenCall[T, R]{Call: call} } -// BarElevenCall wrap *gomock.Call -type BarElevenCall[T any, R any] struct { +// MockBarElevenCall wrap *gomock.Call +type MockBarElevenCall[T any, R any] struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *BarElevenCall[T, R]) Return(arg0 *other.One[T], arg1 error) *BarElevenCall[T, R] { +func (c *MockBarElevenCall[T, R]) Return(arg0 *other.One[T], arg1 error) *MockBarElevenCall[T, R] { c.Call = c.Call.Return(arg0, arg1) return c } // Do rewrite *gomock.Call.Do -func (c *BarElevenCall[T, R]) Do(f func() (*other.One[T], error)) *BarElevenCall[T, R] { +func (c *MockBarElevenCall[T, R]) Do(f func() (*other.One[T], error)) *MockBarElevenCall[T, R] { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *BarElevenCall[T, R]) DoAndReturn(f func() (*other.One[T], error)) *BarElevenCall[T, R] { +func (c *MockBarElevenCall[T, R]) DoAndReturn(f func() (*other.One[T], error)) *MockBarElevenCall[T, R] { c.Call = c.Call.DoAndReturn(f) return c } @@ -161,31 +171,31 @@ func (m *MockBar[T, R]) Fifteen() (typed.Iface[typed.StructType], error) { } // Fifteen indicates an expected call of Fifteen. -func (mr *MockBarMockRecorder[T, R]) Fifteen() *BarFifteenCall[T, R] { +func (mr *MockBarMockRecorder[T, R]) Fifteen() *MockBarFifteenCall[T, R] { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Fifteen", reflect.TypeOf((*MockBar[T, R])(nil).Fifteen)) - return &BarFifteenCall[T, R]{Call: call} + return &MockBarFifteenCall[T, R]{Call: call} } -// BarFifteenCall wrap *gomock.Call -type BarFifteenCall[T any, R any] struct { +// MockBarFifteenCall wrap *gomock.Call +type MockBarFifteenCall[T any, R any] struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *BarFifteenCall[T, R]) Return(arg0 typed.Iface[typed.StructType], arg1 error) *BarFifteenCall[T, R] { +func (c *MockBarFifteenCall[T, R]) Return(arg0 typed.Iface[typed.StructType], arg1 error) *MockBarFifteenCall[T, R] { c.Call = c.Call.Return(arg0, arg1) return c } // Do rewrite *gomock.Call.Do -func (c *BarFifteenCall[T, R]) Do(f func() (typed.Iface[typed.StructType], error)) *BarFifteenCall[T, R] { +func (c *MockBarFifteenCall[T, R]) Do(f func() (typed.Iface[typed.StructType], error)) *MockBarFifteenCall[T, R] { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *BarFifteenCall[T, R]) DoAndReturn(f func() (typed.Iface[typed.StructType], error)) *BarFifteenCall[T, R] { +func (c *MockBarFifteenCall[T, R]) DoAndReturn(f func() (typed.Iface[typed.StructType], error)) *MockBarFifteenCall[T, R] { c.Call = c.Call.DoAndReturn(f) return c } @@ -199,31 +209,31 @@ func (m *MockBar[T, R]) Five(arg0 T) typed.Baz[T] { } // Five indicates an expected call of Five. -func (mr *MockBarMockRecorder[T, R]) Five(arg0 any) *BarFiveCall[T, R] { +func (mr *MockBarMockRecorder[T, R]) Five(arg0 any) *MockBarFiveCall[T, R] { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Five", reflect.TypeOf((*MockBar[T, R])(nil).Five), arg0) - return &BarFiveCall[T, R]{Call: call} + return &MockBarFiveCall[T, R]{Call: call} } -// BarFiveCall wrap *gomock.Call -type BarFiveCall[T any, R any] struct { +// MockBarFiveCall wrap *gomock.Call +type MockBarFiveCall[T any, R any] struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *BarFiveCall[T, R]) Return(arg0 typed.Baz[T]) *BarFiveCall[T, R] { +func (c *MockBarFiveCall[T, R]) Return(arg0 typed.Baz[T]) *MockBarFiveCall[T, R] { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *BarFiveCall[T, R]) Do(f func(T) typed.Baz[T]) *BarFiveCall[T, R] { +func (c *MockBarFiveCall[T, R]) Do(f func(T) typed.Baz[T]) *MockBarFiveCall[T, R] { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *BarFiveCall[T, R]) DoAndReturn(f func(T) typed.Baz[T]) *BarFiveCall[T, R] { +func (c *MockBarFiveCall[T, R]) DoAndReturn(f func(T) typed.Baz[T]) *MockBarFiveCall[T, R] { c.Call = c.Call.DoAndReturn(f) return c } @@ -237,31 +247,31 @@ func (m *MockBar[T, R]) Four(arg0 T) typed.Foo[T, R] { } // Four indicates an expected call of Four. -func (mr *MockBarMockRecorder[T, R]) Four(arg0 any) *BarFourCall[T, R] { +func (mr *MockBarMockRecorder[T, R]) Four(arg0 any) *MockBarFourCall[T, R] { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Four", reflect.TypeOf((*MockBar[T, R])(nil).Four), arg0) - return &BarFourCall[T, R]{Call: call} + return &MockBarFourCall[T, R]{Call: call} } -// BarFourCall wrap *gomock.Call -type BarFourCall[T any, R any] struct { +// MockBarFourCall wrap *gomock.Call +type MockBarFourCall[T any, R any] struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *BarFourCall[T, R]) Return(arg0 typed.Foo[T, R]) *BarFourCall[T, R] { +func (c *MockBarFourCall[T, R]) Return(arg0 typed.Foo[T, R]) *MockBarFourCall[T, R] { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *BarFourCall[T, R]) Do(f func(T) typed.Foo[T, R]) *BarFourCall[T, R] { +func (c *MockBarFourCall[T, R]) Do(f func(T) typed.Foo[T, R]) *MockBarFourCall[T, R] { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *BarFourCall[T, R]) DoAndReturn(f func(T) typed.Foo[T, R]) *BarFourCall[T, R] { +func (c *MockBarFourCall[T, R]) DoAndReturn(f func(T) typed.Foo[T, R]) *MockBarFourCall[T, R] { c.Call = c.Call.DoAndReturn(f) return c } @@ -276,31 +286,31 @@ func (m *MockBar[T, R]) Fourteen() (*typed.Foo[typed.StructType, typed.StructTyp } // Fourteen indicates an expected call of Fourteen. -func (mr *MockBarMockRecorder[T, R]) Fourteen() *BarFourteenCall[T, R] { +func (mr *MockBarMockRecorder[T, R]) Fourteen() *MockBarFourteenCall[T, R] { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Fourteen", reflect.TypeOf((*MockBar[T, R])(nil).Fourteen)) - return &BarFourteenCall[T, R]{Call: call} + return &MockBarFourteenCall[T, R]{Call: call} } -// BarFourteenCall wrap *gomock.Call -type BarFourteenCall[T any, R any] struct { +// MockBarFourteenCall wrap *gomock.Call +type MockBarFourteenCall[T any, R any] struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *BarFourteenCall[T, R]) Return(arg0 *typed.Foo[typed.StructType, typed.StructType2], arg1 error) *BarFourteenCall[T, R] { +func (c *MockBarFourteenCall[T, R]) Return(arg0 *typed.Foo[typed.StructType, typed.StructType2], arg1 error) *MockBarFourteenCall[T, R] { c.Call = c.Call.Return(arg0, arg1) return c } // Do rewrite *gomock.Call.Do -func (c *BarFourteenCall[T, R]) Do(f func() (*typed.Foo[typed.StructType, typed.StructType2], error)) *BarFourteenCall[T, R] { +func (c *MockBarFourteenCall[T, R]) Do(f func() (*typed.Foo[typed.StructType, typed.StructType2], error)) *MockBarFourteenCall[T, R] { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *BarFourteenCall[T, R]) DoAndReturn(f func() (*typed.Foo[typed.StructType, typed.StructType2], error)) *BarFourteenCall[T, R] { +func (c *MockBarFourteenCall[T, R]) DoAndReturn(f func() (*typed.Foo[typed.StructType, typed.StructType2], error)) *MockBarFourteenCall[T, R] { c.Call = c.Call.DoAndReturn(f) return c } @@ -312,31 +322,31 @@ func (m *MockBar[T, R]) Nine(arg0 typed.Iface[T]) { } // Nine indicates an expected call of Nine. -func (mr *MockBarMockRecorder[T, R]) Nine(arg0 any) *BarNineCall[T, R] { +func (mr *MockBarMockRecorder[T, R]) Nine(arg0 any) *MockBarNineCall[T, R] { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Nine", reflect.TypeOf((*MockBar[T, R])(nil).Nine), arg0) - return &BarNineCall[T, R]{Call: call} + return &MockBarNineCall[T, R]{Call: call} } -// BarNineCall wrap *gomock.Call -type BarNineCall[T any, R any] struct { +// MockBarNineCall wrap *gomock.Call +type MockBarNineCall[T any, R any] struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *BarNineCall[T, R]) Return() *BarNineCall[T, R] { +func (c *MockBarNineCall[T, R]) Return() *MockBarNineCall[T, R] { c.Call = c.Call.Return() return c } // Do rewrite *gomock.Call.Do -func (c *BarNineCall[T, R]) Do(f func(typed.Iface[T])) *BarNineCall[T, R] { +func (c *MockBarNineCall[T, R]) Do(f func(typed.Iface[T])) *MockBarNineCall[T, R] { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *BarNineCall[T, R]) DoAndReturn(f func(typed.Iface[T])) *BarNineCall[T, R] { +func (c *MockBarNineCall[T, R]) DoAndReturn(f func(typed.Iface[T])) *MockBarNineCall[T, R] { c.Call = c.Call.DoAndReturn(f) return c } @@ -350,31 +360,31 @@ func (m *MockBar[T, R]) Nineteen() typed.AliasType { } // Nineteen indicates an expected call of Nineteen. -func (mr *MockBarMockRecorder[T, R]) Nineteen() *BarNineteenCall[T, R] { +func (mr *MockBarMockRecorder[T, R]) Nineteen() *MockBarNineteenCall[T, R] { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Nineteen", reflect.TypeOf((*MockBar[T, R])(nil).Nineteen)) - return &BarNineteenCall[T, R]{Call: call} + return &MockBarNineteenCall[T, R]{Call: call} } -// BarNineteenCall wrap *gomock.Call -type BarNineteenCall[T any, R any] struct { +// MockBarNineteenCall wrap *gomock.Call +type MockBarNineteenCall[T any, R any] struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *BarNineteenCall[T, R]) Return(arg0 typed.AliasType) *BarNineteenCall[T, R] { +func (c *MockBarNineteenCall[T, R]) Return(arg0 typed.AliasType) *MockBarNineteenCall[T, R] { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *BarNineteenCall[T, R]) Do(f func() typed.AliasType) *BarNineteenCall[T, R] { +func (c *MockBarNineteenCall[T, R]) Do(f func() typed.AliasType) *MockBarNineteenCall[T, R] { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *BarNineteenCall[T, R]) DoAndReturn(f func() typed.AliasType) *BarNineteenCall[T, R] { +func (c *MockBarNineteenCall[T, R]) DoAndReturn(f func() typed.AliasType) *MockBarNineteenCall[T, R] { c.Call = c.Call.DoAndReturn(f) return c } @@ -388,31 +398,31 @@ func (m *MockBar[T, R]) One(arg0 string) string { } // One indicates an expected call of One. -func (mr *MockBarMockRecorder[T, R]) One(arg0 any) *BarOneCall[T, R] { +func (mr *MockBarMockRecorder[T, R]) One(arg0 any) *MockBarOneCall[T, R] { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "One", reflect.TypeOf((*MockBar[T, R])(nil).One), arg0) - return &BarOneCall[T, R]{Call: call} + return &MockBarOneCall[T, R]{Call: call} } -// BarOneCall wrap *gomock.Call -type BarOneCall[T any, R any] struct { +// MockBarOneCall wrap *gomock.Call +type MockBarOneCall[T any, R any] struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *BarOneCall[T, R]) Return(arg0 string) *BarOneCall[T, R] { +func (c *MockBarOneCall[T, R]) Return(arg0 string) *MockBarOneCall[T, R] { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *BarOneCall[T, R]) Do(f func(string) string) *BarOneCall[T, R] { +func (c *MockBarOneCall[T, R]) Do(f func(string) string) *MockBarOneCall[T, R] { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *BarOneCall[T, R]) DoAndReturn(f func(string) string) *BarOneCall[T, R] { +func (c *MockBarOneCall[T, R]) DoAndReturn(f func(string) string) *MockBarOneCall[T, R] { c.Call = c.Call.DoAndReturn(f) return c } @@ -426,31 +436,31 @@ func (m *MockBar[T, R]) Seven(arg0 T) other.One[T] { } // Seven indicates an expected call of Seven. -func (mr *MockBarMockRecorder[T, R]) Seven(arg0 any) *BarSevenCall[T, R] { +func (mr *MockBarMockRecorder[T, R]) Seven(arg0 any) *MockBarSevenCall[T, R] { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Seven", reflect.TypeOf((*MockBar[T, R])(nil).Seven), arg0) - return &BarSevenCall[T, R]{Call: call} + return &MockBarSevenCall[T, R]{Call: call} } -// BarSevenCall wrap *gomock.Call -type BarSevenCall[T any, R any] struct { +// MockBarSevenCall wrap *gomock.Call +type MockBarSevenCall[T any, R any] struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *BarSevenCall[T, R]) Return(arg0 other.One[T]) *BarSevenCall[T, R] { +func (c *MockBarSevenCall[T, R]) Return(arg0 other.One[T]) *MockBarSevenCall[T, R] { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *BarSevenCall[T, R]) Do(f func(T) other.One[T]) *BarSevenCall[T, R] { +func (c *MockBarSevenCall[T, R]) Do(f func(T) other.One[T]) *MockBarSevenCall[T, R] { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *BarSevenCall[T, R]) DoAndReturn(f func(T) other.One[T]) *BarSevenCall[T, R] { +func (c *MockBarSevenCall[T, R]) DoAndReturn(f func(T) other.One[T]) *MockBarSevenCall[T, R] { c.Call = c.Call.DoAndReturn(f) return c } @@ -465,31 +475,31 @@ func (m *MockBar[T, R]) Seventeen() (*typed.Foo[other.Three, other.Four], error) } // Seventeen indicates an expected call of Seventeen. -func (mr *MockBarMockRecorder[T, R]) Seventeen() *BarSeventeenCall[T, R] { +func (mr *MockBarMockRecorder[T, R]) Seventeen() *MockBarSeventeenCall[T, R] { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Seventeen", reflect.TypeOf((*MockBar[T, R])(nil).Seventeen)) - return &BarSeventeenCall[T, R]{Call: call} + return &MockBarSeventeenCall[T, R]{Call: call} } -// BarSeventeenCall wrap *gomock.Call -type BarSeventeenCall[T any, R any] struct { +// MockBarSeventeenCall wrap *gomock.Call +type MockBarSeventeenCall[T any, R any] struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *BarSeventeenCall[T, R]) Return(arg0 *typed.Foo[other.Three, other.Four], arg1 error) *BarSeventeenCall[T, R] { +func (c *MockBarSeventeenCall[T, R]) Return(arg0 *typed.Foo[other.Three, other.Four], arg1 error) *MockBarSeventeenCall[T, R] { c.Call = c.Call.Return(arg0, arg1) return c } // Do rewrite *gomock.Call.Do -func (c *BarSeventeenCall[T, R]) Do(f func() (*typed.Foo[other.Three, other.Four], error)) *BarSeventeenCall[T, R] { +func (c *MockBarSeventeenCall[T, R]) Do(f func() (*typed.Foo[other.Three, other.Four], error)) *MockBarSeventeenCall[T, R] { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *BarSeventeenCall[T, R]) DoAndReturn(f func() (*typed.Foo[other.Three, other.Four], error)) *BarSeventeenCall[T, R] { +func (c *MockBarSeventeenCall[T, R]) DoAndReturn(f func() (*typed.Foo[other.Three, other.Four], error)) *MockBarSeventeenCall[T, R] { c.Call = c.Call.DoAndReturn(f) return c } @@ -503,31 +513,31 @@ func (m *MockBar[T, R]) Six(arg0 T) *typed.Baz[T] { } // Six indicates an expected call of Six. -func (mr *MockBarMockRecorder[T, R]) Six(arg0 any) *BarSixCall[T, R] { +func (mr *MockBarMockRecorder[T, R]) Six(arg0 any) *MockBarSixCall[T, R] { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Six", reflect.TypeOf((*MockBar[T, R])(nil).Six), arg0) - return &BarSixCall[T, R]{Call: call} + return &MockBarSixCall[T, R]{Call: call} } -// BarSixCall wrap *gomock.Call -type BarSixCall[T any, R any] struct { +// MockBarSixCall wrap *gomock.Call +type MockBarSixCall[T any, R any] struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *BarSixCall[T, R]) Return(arg0 *typed.Baz[T]) *BarSixCall[T, R] { +func (c *MockBarSixCall[T, R]) Return(arg0 *typed.Baz[T]) *MockBarSixCall[T, R] { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *BarSixCall[T, R]) Do(f func(T) *typed.Baz[T]) *BarSixCall[T, R] { +func (c *MockBarSixCall[T, R]) Do(f func(T) *typed.Baz[T]) *MockBarSixCall[T, R] { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *BarSixCall[T, R]) DoAndReturn(f func(T) *typed.Baz[T]) *BarSixCall[T, R] { +func (c *MockBarSixCall[T, R]) DoAndReturn(f func(T) *typed.Baz[T]) *MockBarSixCall[T, R] { c.Call = c.Call.DoAndReturn(f) return c } @@ -542,31 +552,31 @@ func (m *MockBar[T, R]) Sixteen() (typed.Baz[other.Three], error) { } // Sixteen indicates an expected call of Sixteen. -func (mr *MockBarMockRecorder[T, R]) Sixteen() *BarSixteenCall[T, R] { +func (mr *MockBarMockRecorder[T, R]) Sixteen() *MockBarSixteenCall[T, R] { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Sixteen", reflect.TypeOf((*MockBar[T, R])(nil).Sixteen)) - return &BarSixteenCall[T, R]{Call: call} + return &MockBarSixteenCall[T, R]{Call: call} } -// BarSixteenCall wrap *gomock.Call -type BarSixteenCall[T any, R any] struct { +// MockBarSixteenCall wrap *gomock.Call +type MockBarSixteenCall[T any, R any] struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *BarSixteenCall[T, R]) Return(arg0 typed.Baz[other.Three], arg1 error) *BarSixteenCall[T, R] { +func (c *MockBarSixteenCall[T, R]) Return(arg0 typed.Baz[other.Three], arg1 error) *MockBarSixteenCall[T, R] { c.Call = c.Call.Return(arg0, arg1) return c } // Do rewrite *gomock.Call.Do -func (c *BarSixteenCall[T, R]) Do(f func() (typed.Baz[other.Three], error)) *BarSixteenCall[T, R] { +func (c *MockBarSixteenCall[T, R]) Do(f func() (typed.Baz[other.Three], error)) *MockBarSixteenCall[T, R] { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *BarSixteenCall[T, R]) DoAndReturn(f func() (typed.Baz[other.Three], error)) *BarSixteenCall[T, R] { +func (c *MockBarSixteenCall[T, R]) DoAndReturn(f func() (typed.Baz[other.Three], error)) *MockBarSixteenCall[T, R] { c.Call = c.Call.DoAndReturn(f) return c } @@ -578,31 +588,31 @@ func (m *MockBar[T, R]) Ten(arg0 *T) { } // Ten indicates an expected call of Ten. -func (mr *MockBarMockRecorder[T, R]) Ten(arg0 any) *BarTenCall[T, R] { +func (mr *MockBarMockRecorder[T, R]) Ten(arg0 any) *MockBarTenCall[T, R] { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Ten", reflect.TypeOf((*MockBar[T, R])(nil).Ten), arg0) - return &BarTenCall[T, R]{Call: call} + return &MockBarTenCall[T, R]{Call: call} } -// BarTenCall wrap *gomock.Call -type BarTenCall[T any, R any] struct { +// MockBarTenCall wrap *gomock.Call +type MockBarTenCall[T any, R any] struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *BarTenCall[T, R]) Return() *BarTenCall[T, R] { +func (c *MockBarTenCall[T, R]) Return() *MockBarTenCall[T, R] { c.Call = c.Call.Return() return c } // Do rewrite *gomock.Call.Do -func (c *BarTenCall[T, R]) Do(f func(*T)) *BarTenCall[T, R] { +func (c *MockBarTenCall[T, R]) Do(f func(*T)) *MockBarTenCall[T, R] { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *BarTenCall[T, R]) DoAndReturn(f func(*T)) *BarTenCall[T, R] { +func (c *MockBarTenCall[T, R]) DoAndReturn(f func(*T)) *MockBarTenCall[T, R] { c.Call = c.Call.DoAndReturn(f) return c } @@ -617,31 +627,31 @@ func (m *MockBar[T, R]) Thirteen() (typed.Baz[typed.StructType], error) { } // Thirteen indicates an expected call of Thirteen. -func (mr *MockBarMockRecorder[T, R]) Thirteen() *BarThirteenCall[T, R] { +func (mr *MockBarMockRecorder[T, R]) Thirteen() *MockBarThirteenCall[T, R] { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Thirteen", reflect.TypeOf((*MockBar[T, R])(nil).Thirteen)) - return &BarThirteenCall[T, R]{Call: call} + return &MockBarThirteenCall[T, R]{Call: call} } -// BarThirteenCall wrap *gomock.Call -type BarThirteenCall[T any, R any] struct { +// MockBarThirteenCall wrap *gomock.Call +type MockBarThirteenCall[T any, R any] struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *BarThirteenCall[T, R]) Return(arg0 typed.Baz[typed.StructType], arg1 error) *BarThirteenCall[T, R] { +func (c *MockBarThirteenCall[T, R]) Return(arg0 typed.Baz[typed.StructType], arg1 error) *MockBarThirteenCall[T, R] { c.Call = c.Call.Return(arg0, arg1) return c } // Do rewrite *gomock.Call.Do -func (c *BarThirteenCall[T, R]) Do(f func() (typed.Baz[typed.StructType], error)) *BarThirteenCall[T, R] { +func (c *MockBarThirteenCall[T, R]) Do(f func() (typed.Baz[typed.StructType], error)) *MockBarThirteenCall[T, R] { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *BarThirteenCall[T, R]) DoAndReturn(f func() (typed.Baz[typed.StructType], error)) *BarThirteenCall[T, R] { +func (c *MockBarThirteenCall[T, R]) DoAndReturn(f func() (typed.Baz[typed.StructType], error)) *MockBarThirteenCall[T, R] { c.Call = c.Call.DoAndReturn(f) return c } @@ -655,31 +665,31 @@ func (m *MockBar[T, R]) Three(arg0 T) R { } // Three indicates an expected call of Three. -func (mr *MockBarMockRecorder[T, R]) Three(arg0 any) *BarThreeCall[T, R] { +func (mr *MockBarMockRecorder[T, R]) Three(arg0 any) *MockBarThreeCall[T, R] { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Three", reflect.TypeOf((*MockBar[T, R])(nil).Three), arg0) - return &BarThreeCall[T, R]{Call: call} + return &MockBarThreeCall[T, R]{Call: call} } -// BarThreeCall wrap *gomock.Call -type BarThreeCall[T any, R any] struct { +// MockBarThreeCall wrap *gomock.Call +type MockBarThreeCall[T any, R any] struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *BarThreeCall[T, R]) Return(arg0 R) *BarThreeCall[T, R] { +func (c *MockBarThreeCall[T, R]) Return(arg0 R) *MockBarThreeCall[T, R] { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *BarThreeCall[T, R]) Do(f func(T) R) *BarThreeCall[T, R] { +func (c *MockBarThreeCall[T, R]) Do(f func(T) R) *MockBarThreeCall[T, R] { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *BarThreeCall[T, R]) DoAndReturn(f func(T) R) *BarThreeCall[T, R] { +func (c *MockBarThreeCall[T, R]) DoAndReturn(f func(T) R) *MockBarThreeCall[T, R] { c.Call = c.Call.DoAndReturn(f) return c } @@ -694,31 +704,31 @@ func (m *MockBar[T, R]) Twelve() (*other.Two[T, R], error) { } // Twelve indicates an expected call of Twelve. -func (mr *MockBarMockRecorder[T, R]) Twelve() *BarTwelveCall[T, R] { +func (mr *MockBarMockRecorder[T, R]) Twelve() *MockBarTwelveCall[T, R] { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Twelve", reflect.TypeOf((*MockBar[T, R])(nil).Twelve)) - return &BarTwelveCall[T, R]{Call: call} + return &MockBarTwelveCall[T, R]{Call: call} } -// BarTwelveCall wrap *gomock.Call -type BarTwelveCall[T any, R any] struct { +// MockBarTwelveCall wrap *gomock.Call +type MockBarTwelveCall[T any, R any] struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *BarTwelveCall[T, R]) Return(arg0 *other.Two[T, R], arg1 error) *BarTwelveCall[T, R] { +func (c *MockBarTwelveCall[T, R]) Return(arg0 *other.Two[T, R], arg1 error) *MockBarTwelveCall[T, R] { c.Call = c.Call.Return(arg0, arg1) return c } // Do rewrite *gomock.Call.Do -func (c *BarTwelveCall[T, R]) Do(f func() (*other.Two[T, R], error)) *BarTwelveCall[T, R] { +func (c *MockBarTwelveCall[T, R]) Do(f func() (*other.Two[T, R], error)) *MockBarTwelveCall[T, R] { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *BarTwelveCall[T, R]) DoAndReturn(f func() (*other.Two[T, R], error)) *BarTwelveCall[T, R] { +func (c *MockBarTwelveCall[T, R]) DoAndReturn(f func() (*other.Two[T, R], error)) *MockBarTwelveCall[T, R] { c.Call = c.Call.DoAndReturn(f) return c } @@ -732,54 +742,31 @@ func (m *MockBar[T, R]) Two(arg0 T) string { } // Two indicates an expected call of Two. -func (mr *MockBarMockRecorder[T, R]) Two(arg0 any) *BarTwoCall[T, R] { +func (mr *MockBarMockRecorder[T, R]) Two(arg0 any) *MockBarTwoCall[T, R] { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Two", reflect.TypeOf((*MockBar[T, R])(nil).Two), arg0) - return &BarTwoCall[T, R]{Call: call} + return &MockBarTwoCall[T, R]{Call: call} } -// BarTwoCall wrap *gomock.Call -type BarTwoCall[T any, R any] struct { +// MockBarTwoCall wrap *gomock.Call +type MockBarTwoCall[T any, R any] struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *BarTwoCall[T, R]) Return(arg0 string) *BarTwoCall[T, R] { +func (c *MockBarTwoCall[T, R]) Return(arg0 string) *MockBarTwoCall[T, R] { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *BarTwoCall[T, R]) Do(f func(T) string) *BarTwoCall[T, R] { +func (c *MockBarTwoCall[T, R]) Do(f func(T) string) *MockBarTwoCall[T, R] { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *BarTwoCall[T, R]) DoAndReturn(f func(T) string) *BarTwoCall[T, R] { +func (c *MockBarTwoCall[T, R]) DoAndReturn(f func(T) string) *MockBarTwoCall[T, R] { c.Call = c.Call.DoAndReturn(f) return c } - -// MockIface is a mock of Iface interface. -type MockIface[T any] struct { - ctrl *gomock.Controller - recorder *MockIfaceMockRecorder[T] -} - -// MockIfaceMockRecorder is the mock recorder for MockIface. -type MockIfaceMockRecorder[T any] struct { - mock *MockIface[T] -} - -// NewMockIface creates a new mock instance. -func NewMockIface[T any](ctrl *gomock.Controller) *MockIface[T] { - mock := &MockIface[T]{ctrl: ctrl} - mock.recorder = &MockIfaceMockRecorder[T]{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockIface[T]) EXPECT() *MockIfaceMockRecorder[T] { - return m.recorder -} diff --git a/tools/go.mod b/tools/go.mod index a6e24ec..8cbd354 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -1,6 +1,6 @@ module github.com/uber-go/mock/tools -go 1.21 +go 1.19 require github.com/stretchr/testify v1.9.0