Open jpopadak opened 4 years ago
Thanks to a coworker, just found this option on pegomock generate
:
--mock-name=MOCK-NAME Struct name of the generated mock; defaults to the interface prefixed with Mock
Should be sufficient enough for what I am trying to do. :) Might be useful to have an example of this as well in the README.
@jpopadak Glad you found the way to solve it.
In general, I avoided documenting CLI options that are more or less obvious from the CLI help to avoid repeating the description. For such options, the README specifically says:
For more flags, run:
pegomock --help
If you feel like this is still worth being documented explicitly, I'd be happy to merge a PR ;-).
Do you have any suggestions for duplicate interface names?
For example, I have this type:
Both
first.Client
andsecond.Client
are named the same.As a result, when I try to create the mocks, I get two files, both with
NewMockClient()
in them. Is there anyway I can specify a way to override the function name? LikeNewMockFirstClient()
andNewMockSecondClient()
?I can change the package, but then I get issues with Go (and Linters) complaining there is more than one package in the same folder.