http://play.golang.org/p/lF2ZgAyxei
How do I 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 does not grab the key and only returns empty results.
How do I escape the comma?