We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
gotip
I'm trying to create a struct with reflect that is equal to an existing struct that has embedded/anonymous fields.
reflect
I found that it is not possible to use reflect to create a struct with embedded/anonymous members.
Generally, it is possible to create a struct with reflect if all the fields are named, but not in this case where the fields are unnamed (embedded).
I created a playground snippet which I hope clearly demonstrates the issue, as well as what I expect to happen under normal circumstances:
https://go.dev/play/p/BmUv11ZJkay?v=gotip
I expect it to be possible to build a struct with reflect that can be compared as equal to any existing struct with public members.
The text was updated successfully, but these errors were encountered:
Duplicate of #24781
Sorry, something went wrong.
No branches or pull requests
Go version
gotip
What did you do?
I'm trying to create a struct with
reflect
that is equal to an existing struct that has embedded/anonymous fields.What did you see happen?
I found that it is not possible to use
reflect
to create a struct with embedded/anonymous members.Generally, it is possible to create a struct with reflect if all the fields are named, but not in this case where the fields are unnamed (embedded).
I created a playground snippet which I hope clearly demonstrates the issue, as well as what I expect to happen under normal circumstances:
https://go.dev/play/p/BmUv11ZJkay?v=gotip
What did you expect to see?
I expect it to be possible to build a struct with reflect that can be compared as equal to any existing struct with public members.
The text was updated successfully, but these errors were encountered: