Skip to content

Missing parameter names in interface methods #12

@kinbiko

Description

@kinbiko

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions