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

Make source mode command line arguments consistent with reflect mode #136

@sam701

Description

@sam701

Here is the basic usage of the reflect mode

mockgen database/sql/driver Conn,Driver

It would be helpful to make the source mode usage to be like this:

mockgen -source-dir myPackageDir privateInterface1,privateInterface2,PublicInterface3

This approach has a few benefits:

  1. All generated mocks of a package will reside in a single file. Currently if you need to mock just a couple of interfaces, you might run mockgen for every single file in the package. This leads to many unneeded files. Some of them don't contain any mocks. Additionally you cannot do it in a single mockgen call but have to loop in a script file.
  2. It makes straightforward to mock specific private interfaces. Currently all interfaces from the source file will be mocked, even if some of them are not required to be mocked.
  3. Last but not least, it is consistent with the reflect mode.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions