-
Notifications
You must be signed in to change notification settings - Fork 18k
reflect: StructTag.Get does not return 1st tag of dynamic structure created with StructOf #66645
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
Comments
I think maybe you can change the StructTag key. |
Thanks for reporting. https://pkg.go.dev/reflect#StructTag documentation says:
It looks like the provided code is inadvertently defining a key named Closing since there doesn't appear to be a problem in the CC @golang/runtime. |
Go version
go1.22.0 linux/amd64
Output of
go env
in your module/workspace:What did you do?
I am working with reflection package, creating dynamic structures with
reflect.StructOf
.Later on I inspect these structure tags and 1st tag is always missing for any field.
I have simple UT
What did you see happen?
In above test, k1 is missing
What did you expect to see?
I would expect all tags returned, including k1
The text was updated successfully, but these errors were encountered: