-
-
Notifications
You must be signed in to change notification settings - Fork 126
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
Support for mocking core types #191
Comments
@gr8routdoors what use cases do you have for this? Would it be mocking interfaces only? |
Hey, thanks for all the work you're doing, this project is great! Regarding this issue, I have a similar use case, for example I'm using a If there's a way to do it (that I don't know), please excuse me 😅 Thanks again! |
Honestly, it might be easier to write a quick This doesn't negate the discussion around this feature though. Just trying to understand it a bit more. |
I can see the argument to have them look/feel the same as the other mocks though. So yeah, this feels more and more like something we should support. |
True, for this simple specific case, I ended up creating a mock manually. But I could imagine other scenarios. Thanks Mat! |
Without any real testing, it looks like this works:
but it would be nice to have an install agnostic way to spell |
Or:
|
You might also consider using a type alias or simply copying the interface to your code, as discussed in #172 (comment) |
Have you considered adding the ability to mock built-in golang types? It seems like a mixed bag out there of libraries and people hand rolling various core type mocks. Seems like this might be useful and potentially doable through additions to the registry loading logic.
The text was updated successfully, but these errors were encountered: