Skip to content
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

Fix var name generation to avoid conflict #145

Merged
merged 1 commit into from
Feb 14, 2021
Merged

Conversation

sudo-suhas
Copy link
Collaborator

When the type and the package name is the same for an anonymous
parameter (ex: time.Time), and there are more than 1 such parameters,
the generated name for both was the same. And the generated code would
not be valid.

Fix the bug by ensuring the parameter name does not conflict with
package imports first before checking against other parameter names.

Closes #144

cc: @breml

When the type and the package name is the same for an anonymous
parameter (ex: time.Time), and there are more than 1 such parameters,
the generated name for both was the same. And the generated code would
not be valid.

Fix the bug by ensuring the parameter name does not conflict with
package imports first before checking against other parameter names.
@matryer matryer merged commit fe0d4f3 into master Feb 14, 2021
@matryer matryer deleted the fix-param-name-conflict branch February 14, 2021 13:10
@breml
Copy link
Contributor

breml commented Feb 15, 2021

Thanks @sudo-suhas, I will give the new release a try later this week.

@breml
Copy link
Contributor

breml commented Feb 16, 2021

@sudo-suhas Tested the new release successfully, thanks again for the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failing mock generation with two arguments of type time.Time
3 participants