Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing parameter names in interface methods #12

Open
kinbiko opened this issue Mar 26, 2020 · 0 comments
Open

Missing parameter names in interface methods #12

kinbiko opened this issue Mar 26, 2020 · 0 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@kinbiko
Copy link
Owner

kinbiko commented Mar 26, 2020

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 kinbiko added bug Something isn't working good first issue Good for newcomers labels Mar 26, 2020
@kinbiko kinbiko moved this to Todo in Open Source Oct 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
Status: Todo
Development

No branches or pull requests

1 participant