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

Unexported interface methods are internal #50

Closed
MichaelUrman opened this issue May 30, 2024 · 1 comment · Fixed by #52
Closed

Unexported interface methods are internal #50

MichaelUrman opened this issue May 30, 2024 · 1 comment · Fixed by #52

Comments

@MichaelUrman
Copy link
Contributor

When an interface method is not exported, its implementation can be assumed to wrap errors. This can be implemented by requiring sel.Sel.IsExported() before checking for isInterface(pass, sel).

Then e.g., the test interface_on_struct can be extended to define a decode(v interface{}) error and call it without issuing an error.

@tomarrell
Copy link
Owner

Fair enough, if you would like to open a PR and include a test case I'd be happy to review it.

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

Successfully merging a pull request may close this issue.

2 participants