Go escape comma in JSON -
http://play.golang.org/p/lf2zgayxei
how escape comma in json tag in go?
type aa struct { mystr string `json:"sub,ject"` } func main() { jsonstr := ` { "sub,ject": "i" } ` stt := new(aa) json.unmarshal([]byte(jsonstr), stt) fmt.println(stt) t, _ := strconv.unquote(jsonstr) fmt.println(t) }
this not grab key , returns empty results.
how escape comma?
the code used json encoding package parse field tags in tags.go. code splits field name options @ first comma. not possible escape comma.
Comments
Post a Comment