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

Description
Requested feature
Currently, if I run mockgen on a file, it only seems to generate mock versions of interfaces. I propose it should also generate mock versions of functions. So if my file contains a line like
Then mockgen should be able to generate a mocked instance of that function. So I should be able to write something like:
ctrl := gomock.NewController(t)
m := NewMockTestFunc(ctrl)
m.EXPECT().Return(101)
m.EXPECT().Return(102)
m.Func()() // Returns 101
m.Func()() // Returns 102
Why the feature is needed
Sometimes, dependencies to code are not interfaces but simple function callbacks. It would be nice if I can use gomock to mock these function callbacks. I understand a work around would be to wrap such a callback into an interface, but it would be nice if that was not needed.