Closed hongshaoyang closed 3 years ago
Since package names are not camelCased, adding words into them is bit finicky, hence usually trying to keep them one word etc. Using _ is already established in things like package_test, so I don't see any reason to change this.
Besides -package=
lets you set it whatever you like...
I think the underscore notation is okay for mock. As @KlausVii points out you can change the default with a flag. I personally always manually specify the package flag. Every project is a little different and I don't think there is a good "one" solution here. Closing since this is overridable.
Requested feature
By default, Mockgen creates package names with
mock_
concatenated with the package of the input file.This goes against guidelines, as documented in https://blog.golang.org/package-names:
And in Effective Go: MixedCaps:
(Optional) Proposed solution
By default, Mockgen should create package names with
mock
concatenated with the package of the input file.