golang / mock

GoMock is a mocking framework for the Go programming language.
Apache License 2.0
9.26k stars 608 forks source link

Ability to customize package_prefix instead of using mock_ #661

Closed yuamera closed 2 years ago

yuamera commented 2 years ago

Requested feature

When using mockgen, when no package name is specified, you want to be able to customize the prefix or empty string instead of using mock_

Why the feature is needed

When I use mockgen to generate code for the interface generated by protobuf, I just want to be able to put them in the same package without knowing what the package name is. Especially when protobuf specifies a unique go package name

Proposed solution

Add a -package_prefix parameter to set the prefix instead of hard-coding mock_ ?