Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
encoding/json: does not recognise semicolon as a valid field name #39189
What version of Go are you using (
I don't see a reason why not, but where do we draw the line on which characters are OK and which are not? And why is the semicolon part of the first group?
I'm not familiar with the history of that piece of code, so I really am asking. I think that needs an answer before we review a change.
Back in February of 2011, the entirety of the struct tag was used as the JSON key name. It seems that the name syntax was restricted (https://golang.org/cl/4173061) so that the tags could in theory be used for other purposes like protocol buffers (#1520).
Later in June of 2011, a well-defined grammar for application-specific struct tags was defined and formally implemented in the reflect package (https://golang.org/cl/4645069).
It seems to me that the restricted set of valid characters is an artifact from a previous era to work around a limitation that no longer applies today.
The only restriction I can imagine for the character set would be a
If the grammar is opened up to other characters, we'll need to consider how the