encoding/json: A JSON tag can be any valid JSON string.

Fixes #3887.

R=golang-dev, daniel.morsing, remyoudompheng, rsc
CC=golang-dev
https://golang.org/cl/6997045
This commit is contained in:
Stéphane Travostino 2012-12-22 13:36:55 -05:00 committed by Russ Cox
parent 1cad1f8d1c
commit 475f3df43f
2 changed files with 11 additions and 1 deletions

View file

@ -437,7 +437,7 @@ func isValidTag(s string) bool {
}
for _, c := range s {
switch {
case strings.ContainsRune("!#$%&()*+-./:<=>?@[]^_{|}~", c):
case strings.ContainsRune("!#$%&()*+-./:<=>?@[]^_{|}~ ", c):
// Backslash and quote chars are reserved, but
// otherwise any punctuation chars are allowed
// in a tag name.