-
Notifications
You must be signed in to change notification settings - Fork 420
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
Inlined interfaces #531
Comments
I think I can implement this, if no takers! |
Can you create a proposal of how this would be implemented? Mockery would need to generate some named mock implementation of the inlined interface. I fear whatever implementation you have is going to be kind of messy, but I'm open to hear what you think. |
I see, so the concern here is that mockery does not have suitable
abstractions for this? ok! noted.
I did not look into code yet. I think if it is fast enough to hack, will
make PR. But if lots of work, then will ping you guys here again.
Cheers ! 🤝
…On Sat, 4 Feb 2023 at 07:09, Landon Clipp ***@***.***> wrote:
Can you create a proposal of how this would be implemented? Mockery would
need to generate some named mock implementation of the inlined interface. I
fear whatever implementation you have is going to be kind of messy, but I'm
open to hear what you think.
—
Reply to this email directly, view it on GitHub
<#531 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAWMCRMMZU3VT7ILEBFY223WVWF3TANCNFSM6AAAAAAUCFL3KM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
The problem is moreso that mockery searches a package's global scope for named interface types. If an interface definition lies inline a function signature, mockery would then need to also inspect the function signature of every top-level function. It would then need to also assign a name to that interface. It's not an impossible task, but it's not as simple as you might think. |
Going to close this as we won't be implementing it. |
Description
Purpose
Avoid declaring non exported upstream interfaces as separate types just so they can be mocked.
Details
https://go.dev/play/p/Bt74sBt01Yl
The text was updated successfully, but these errors were encountered: