~~~
mapj1 := make(map[string]interface{})
mapj1["name"] = "名1"
mapj1["config"] = `{"is_ok","yes"}`
b1, _ := json.Marshal(mapj1)
fmt.Println(string(b1))
结果:{"config":"{\"is_ok\",\"yes\"}","name":"名1"}
我要实现效果:
{"name":"名1","config":{"is_ok","yes"}}
请问我是哪里没有做对?
~~~
有疑问加站长微信联系(非本文作者)