Skip to content

reflect: StructOf should support non-ASCII field names or types #15064

Closed
@sbinet

Description

@sbinet

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:

// isExported reports whether name is an exported Go symbol
// (that is, whether it begins with an upper-case letter).
//
func isExported(name string) bool {
    ch, _ := utf8.DecodeRuneInString(name)
    return unicode.IsUpper(ch)
}

But reflect should not embed the whole lot of UTF-8 symbol tables.
We need to fix that before go-1.7

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions