Fixed -mockNames not propagating to Recorder and ReturnCall types#127
Fixed -mockNames not propagating to Recorder and ReturnCall types#127r-hang merged 3 commits intouber-go:mainfrom
Conversation
r-hang
left a comment
There was a problem hiding this comment.
The idea make sense to me. However, I think there are advantages to keeping *model.Interface plumbed through the calls to GenerateMockRecorderMethod and GenerateMockReturnCall method in case we need the richer representation in future code generation changes. Where we use intf.Name could we just use g.MockName(int.Name) instead?
Could we also add a test for this scenario under mockgen/internal/tests?
Sure thing, i'll bring back the parameter *model.Interface.
Of course |
7d44f56 to
196a352
Compare
0c6bbe9 to
66690a2
Compare
66690a2 to
753b99b
Compare
When you are trying to mock multiple interfaces with the same name and similar methods (for example user.Service Create, post.Service Create, etc..) there is collision in Recorder and ReturnCall types, the -mockNames parameter only changes the main interface name, with the changes proposed in this PR the correct mockName will be applied to the Recorder and ReturnCall types.
Addresses #117