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

Interfacer generates invalid code when package name contains hyphen #37

Open
paprikati opened this issue Apr 2, 2022 · 1 comment
Open

Comments

@paprikati
Copy link

We've tried to run interfacer against github.com/PagerDuty/go-pagerduty.Client.
When one of the function arguments is a package name, it generates:

	ListAuditRecordsPaginated(context.Context, pagerduty.ListAuditRecordsOptions, func(go-pagerduty.AuditRecord) bool) ([]pagerduty.AuditRecord, error)

however, go-pagerduty isn't a valid package name.
Would it be possible to pass args to tell interfacer which package name to use in this scenario?

@rjeczalik
Copy link
Owner

Would it be possible to pass args to tell interfacer which package name to use in this scenario?

I think interfaces should be smart enough to read the actual name of the package. Right now it does a dumb thing - it tries to infer the name from the (file-) import path.

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

2 participants