Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

Add -package_format to customize the generated package name #632

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dr-dime
Copy link

@dr-dime dr-dime commented Mar 25, 2022

Previously -package must be explicitly defined or it will default
to mock_${name}. To generate a mock file that sits next to the
package files, eg. as part of the test, one must extract the package
name first. Which is not scripting-friendly.

After this change, we can use -package_format to customize the
generated package name. So that a script can run mockgen without
knowing the package name first.

Fixes #631

Previously -package must be explictly defined or it will default
to `mock_${name}`. To generate a mock file that sits next to the
package files, eg. as part of the test, one must inspect the package
name first. Which is not scripting friendly.

After this change, we can use -package_format to customize the
generated package name. So that a script can run mockgen without
knowning the package name first.
@dr-dime dr-dime requested a review from codyoss as a code owner March 25, 2022 03:45
@dr-dime
Copy link
Author

dr-dime commented Apr 10, 2022

@codyoss friendly ping.

1 similar comment
@dr-dime
Copy link
Author

dr-dime commented Apr 10, 2022

@codyoss friendly ping.

@yuamera
Copy link

yuamera commented Jun 24, 2022

I also have the same needs, I hope to use it as soon as possible, thank you!

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

Successfully merging this pull request may close these issues.

Support customizing generated mock package name
2 participants