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

Is it possible to include parameter names when generating an interface using interfacer #33

Open
paprikati opened this issue Jan 15, 2022 · 3 comments

Comments

@paprikati
Copy link

Is it possible to include parameter names when generating an interface using interfacer?

Currently, all the function parameter names are stripped so

 FooBar(ctx context.Context, eventContext string, includePrivate bool, includeGeo bool)

becomes

FooBar(ctx, string, bool, bool)

which is much harder to work with.

@OscarVanL
Copy link

I would prefer this too :)

@rjeczalik
Copy link
Owner

Overall this is good idea, I am not sure go/types gives you the name of the arguments in a typed func def. This needs to be researched.

@OscarVanL
Copy link

Overall this is good idea, I am not sure go/types gives you the name of the arguments in a typed func def. This needs to be researched.

Mockgen does this for generated mocks arg names, so maybe it's a good reference for how to achieve it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants