mokku icon indicating copy to clipboard operation
mokku copied to clipboard

Missing parameter names in interface methods

Open kinbiko opened this issue 5 years ago • 0 comments

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.

kinbiko avatar Mar 26 '20 13:03 kinbiko