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

Adjust for reflect.Type.NumMethod change in Go1.16 #240

Merged
merged 1 commit into from Oct 20, 2020
Merged

Conversation

dsnet
Copy link
Collaborator

@dsnet dsnet commented Oct 20, 2020

In Go1.16, the reflect.Type.NumMethod method will no longer report
unexported fields, matching the documented behavior on the method.
This means that t.NumMethod() == 0 is no longer a reliable means
to detect whether an interface type is the empty interface or not.
Fix the code to check whether the empty interface itself implements
the target type.

In Go1.16, the reflect.Type.NumMethod method will no longer report
unexported fields, matching the documented behavior on the method.
This means that t.NumMethod() == 0 is no longer a reliable means
to detect whether an interface type is the empty interface or not.
Fix the code to check whether the empty interface itself implements
the target type.
@dsnet dsnet requested a review from neild October 20, 2020 20:57
@dsnet
Copy link
Collaborator Author

dsnet commented Oct 20, 2020

See golang/go#22075 for details.

@dsnet dsnet merged commit ab46b8b into master Oct 20, 2020
@dsnet dsnet deleted the empty-iface branch October 20, 2020 21:23
dsnet added a commit that referenced this pull request Nov 11, 2020
This reverts commit ab46b8b.
The upstream change in Go1.16 has been rolled back.
See golang/go#42123
dsnet added a commit that referenced this pull request Nov 12, 2020
)

This reverts commit ab46b8b.
The upstream change in Go1.16 has been rolled back.
See golang/go#42123
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 this pull request may close these issues.

None yet

2 participants