2021
06-04
06-04
浅谈Golang 嵌套 interface 的赋值问题
大家还是直接看代码吧~packagemainimport("fmt")funcmain(){s:=map[string]interface{}{"code":0,"msg":"","data":map[string]interface{}{"src":"",},}s["data"].(map[string]interface{})["src"]="abc"//修改一个属性,类型转换为map[string]interface{}s["data"].(map[string]interface{})["new"]="bbb"//新增一个属性...
继续阅读 >