-
Notifications
You must be signed in to change notification settings - Fork 18k
reflect: StructOf should support non-ASCII field names or types #15064
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
Labels
Milestone
Comments
gopherbot
pushed a commit
that referenced
this issue
Apr 1, 2016
This change exposes a facility to create new struct types from a slice of reflect.StructFields. - reflect: first stab at implementing StructOf - reflect: tests for StructOf StructOf creates new struct types in the form of structTypeWithMethods to accomodate the GC (especially the uncommonType.methods slice field.) Creating struct types with embedded interfaces with unexported methods is not supported yet and will panic. Creating struct types with non-ASCII field names or types is not yet supported (see #15064.) Binaries' sizes for linux_amd64: old=tip (0104a31) old bytes new bytes delta bin/go 9911336 9915456 +0.04% reflect 781704 830048 +6.18% Updates #5748. Updates #15064. Change-Id: I3b8fd4fadd6ce3b1b922e284f0ae72a3a8e3ce44 Reviewed-on: https://go-review.googlesource.com/9251 Reviewed-by: David Crawshaw <[email protected]> Run-TryBot: David Crawshaw <[email protected]>
CL https://golang.org/cl/21777 mentions this issue. |
CL https://golang.org/cl/23170 mentions this issue. |
gopherbot
pushed a commit
that referenced
this issue
May 17, 2016
The initial implementation of reflect.StructOf in https://golang.org/cl/9251 had a limitation that field names had to be ASCII, which was later lifted by https://golang.org/cl/21777. Remove the out-of-date documentation disallowing UTF-8 field names. Updates: #5748 Updates: #15064 Change-Id: I2c5bfea46bfd682449c6e847fc972a1a131f51b7 Reviewed-on: https://go-review.googlesource.com/23170 Reviewed-by: David Crawshaw <[email protected]>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
see https://golang.org/cl/9251 for more details but in a nutshell:
reflect.StructOf
needs to know whether a field is exported or not.To do that, the canonical way is:
But
reflect
should not embed the whole lot of UTF-8 symbol tables.We need to fix that before
go-1.7
The text was updated successfully, but these errors were encountered: