-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Go 1.18 generics #202
Comments
I want to follow-up this issue in case there is a plan for supporting go 1.18 generics.
After looking deeper in the code, I realized that the library uses |
hey @hleonps , were you able to generate mocks for any interface using generics? If yes, let me know how that worked. |
@chattarajoy My problem came with counterfeiter not recognizing |
The original poster of this issue seemed only to have a problem with considering
It defnitely does not work, currently, since it attempts to create a filename that includes the generic type specifiers between square brackets, nor can you specify multiple mocks in a single line like in my example. |
Right it doesn't work for generic interfaces as of now. |
For the record, while it doesn't generate generic interfaces, the underlying generated code is perfectly compatible with generics. I just manually added a generic type specifier to an already-generated mock and everything worked just fine. It seems that all it needs is an understanding of the syntax and the ability to generate mocks using the syntax. |
Gentle bump here. This is going to be the slow death of this library if not fixed :). |
I'm open to a PR! I just haven't written any code yet that requires this, making it hard to prioritize. |
@joefitzgerald I added the above PR for review - to support interfaces with generics. |
My PR was merged which should fix this if you use the latest version.
I think we can close this issue now. |
First of all, love your library.
I was wondering if you plan on supporting the go 1.18 generics in the near future.
I'm happy to help if you give me some pointers on guidance on how you would approach this
The text was updated successfully, but these errors were encountered: