-
Notifications
You must be signed in to change notification settings - Fork 607
gomock/controller: use skip additional frame #443
Conversation
In 8321731, the callerInfo call gets nested within an additional function call, but the frame skip isn't updated. When used with mockgen, this causes the location frame to unhelpfully point to the generated mock instead of the callsite in the user's test. Before: ... at .../mocks/mock_ecriface/mock_ECRAPI.go:612 because: there are no expected calls of... After: ... at .../example_test.go:29 because: there are no expected calls of...
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
1 similar comment
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
1 similar comment
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution. I think we should just document the magic number a little.
Add an explanation for future readers, explaining callerInfo and when it should be updated.
@codyoss thanks for looking. i added a commit documenting both usages of callerInfo and explaining the skip number. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution!
Description
In 8321731, the callerInfo call
gets nested within an additional function call, but the frame skip
isn't updated. When used with mockgen, this causes the location frame
to unhelpfully point to the generated mock instead of the callsite in
the user's test.
Before:
After:
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
Reviewer Notes
Release Notes
Describe any changes here so maintainer can include it in the release notes, or delete this block.