Skip to content

encoding/json: need to clarify case sensitivity on Unmarshal documentation? #11673

@PragmaticCypher

Description

@PragmaticCypher

go version go1.4.2 linux/amd64

According to the documentation for json.Unmarshal:

"To unmarshal JSON into a struct, Unmarshal matches incoming object keys to the keys used by Marshal (either the struct field name or its tag), preferring an exact match but also accepting a case-insensitive match."

However the library will use the last instance of the field.

http://play.golang.org/p/LtwChO_tp0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions