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

Popular posts from this blog

Python Kivy ListView: How to delete selected ListItemButton? -

asp.net mvc 4 - A specified Include path is not valid. The EntityType '' does not declare a navigation property with the name '' -