diff options
| author | Sean Liao <seankhliao@gmail.com> | 2020-05-21 17:52:33 +0200 |
|---|---|---|
| committer | Daniel Martí <mvdan@mvdan.cc> | 2020-09-24 18:05:54 +0000 |
| commit | 25a33daa2b7e7bda773705215113450923ae4815 (patch) | |
| tree | 07830a8c17817e748369a6f6aa91bc919166c331 /src/encoding/json/encode.go | |
| parent | 0f55d37d440d83f206bfc00b4a2521c1a0bb258b (diff) | |
| download | go-25a33daa2b7e7bda773705215113450923ae4815.tar.xz | |
encoding/json: allow semicolon in field key / struct tag
Allow ';' as a valid character for json field keys and struct tags.
Fixes #39189
Change-Id: I4b602a1b0674ff028db07623682f0d1e8e9fd6c9
Reviewed-on: https://go-review.googlesource.com/c/go/+/234818
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Giovanni Bajo <rasky@develer.com>
Trust: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Diffstat (limited to 'src/encoding/json/encode.go')
| -rw-r--r-- | src/encoding/json/encode.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/encoding/json/encode.go b/src/encoding/json/encode.go index 578d551102..c2d191442c 100644 --- a/src/encoding/json/encode.go +++ b/src/encoding/json/encode.go @@ -946,7 +946,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. |
