Actual behavior
Using -mock_names option does not alter the name of ...Call structs.
e.g. mockgen -typed=true -mock_names=Writer=OtherWriter io Writer generates
// WriterWriteCall wrap *gomock.Call
type WriterWriteCall struct {
*gomock.Call
}
This causes problems if using -mock_names to avoid clashes between mocks for interfaces with the same name (e.g. if I have my own Writer interface and also want to mock io.Writer in the same package) since there will be multiple structs with the same type name in the same package.
Expected behavior
I expect using -mock_names option to change the name of ...Call structs.
e.g. mockgen -typed=true -mock_names=Writer=OtherWriter io Writer generates
// OtherWriterWriteCall wrap *gomock.Call
type OtherWriterWriteCall struct {
*gomock.Call
}
To Reproduce
Run mockgen -typed=true -mock_names=Writer=OtherWriter io Writer
Actual behavior Using
-mock_names
option does not alter the name of...Call
structs.e.g.
mockgen -typed=true -mock_names=Writer=OtherWriter io Writer
generatesThis causes problems if using
-mock_names
to avoid clashes between mocks for interfaces with the same name (e.g. if I have my ownWriter
interface and also want to mockio.Writer
in the same package) since there will be multiple structs with the same type name in the same package.Expected behavior I expect using
-mock_names
option to change the name of...Call
structs.e.g.
mockgen -typed=true -mock_names=Writer=OtherWriter io Writer
generatesTo Reproduce
Run
mockgen -typed=true -mock_names=Writer=OtherWriter io Writer
Additional Information
Triage Notes for the Maintainers