mokku
mokku copied to clipboard
Missing parameter names in interface methods
Did
Copied the following struct:
type foobar interface {
baz(context.Context, int)
}
and ran mokku, and pasted the result.
Expected
A mock struct that compiles.
Got
A compile error, because the resulting mocked method attempts to pass context as a parameter to the underlying Func.
Suggestion
In the case that parameters are not named, we should create a dummy variable name.
a,b, etc is probably fine for unnamed parameters. If users have more than 26 variable names then, well... there are bigger design issues at hand.