-
-
Notifications
You must be signed in to change notification settings - Fork 122
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
Add static interface implementation check #59
Conversation
1af0fa1
to
612a305
Compare
@matryer rebased this PR, so it should be ready to be merged. |
@breml I'm not sure we need this, wouldn't that basically happen when you come to use the mock anyway? I.e. if you're passing it into something that accepts the original interface, it'll be checked then? |
@matryer In principle I agree. I see two advantages of this
For me, the |
@matryer have you considered my comment above? |
@breml If this is worth having, then we could always include it rather than it being configuration? |
612a305
to
ab1b828
Compare
@matryer I updated the PR. Now there is no longer a flag, the additional static check is added to every generated mock file. |
ab1b828
to
5c0f815
Compare
5c0f815
to
1e76148
Compare
Add an additional line of code per interface to the generated mock file, which allows the go compiler to statically check if the mock implements the mocked interface.
1e76148
to
b215924
Compare
Rebased, now TravisCI is happy. |
With the flag staticcheck set, an additional line of code per interface is
added to the generated mock file, which allows the go compiler to statically
check if the mock implements the mocked interface.