You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 27, 2023. It is now read-only.
Mockgen should support generating mocks for interfaces with generics.
Why the feature is needed
The Go 1.18 is planned to be released soon, and I noticed that the mockgen tool doesn't support the generic. When a type parameter is in the interface, mockgen will throw an error.
> go run github.com/golang/mock/mockgen -source=generic_mock.go
2022/02/13 10:59:41 Loading input failed: don't know how to mock method of type *ast.IndexExprexit status 1
(Optional) Proposed solution
In the code example above, the StudentRepository interface is concrete, so the gererated mock should be concrete too with the type parameters substituted.
The BaseRepository interface is abstract, so the generated mock struct should also have the same type parameters.
(My use case only needs 1, which mockery supports as of today.)
noseglid, CannibalVox, ponko2, booscaaa, cstaud and 22 more