标签:ret return 中华 失败 span inter nbsp pre str
package main import ( "encoding/json" "fmt" ) var JsonStr = `[{"hobby":["抽中华","喝牛栏山","烫花卷头"],"name":"王钢弹"}, {"hobby":["抽中华","喝茅台","烫沙宣"],"name":"王铁弹"}, {"hobby":["抽玉溪","喝五粮液","烫波浪头"],"name":"王钢弹"}]` //反序列化jsonstr 为map类型的slice func main011() { JsonBytes := []byte(JsonStr) dataSlice := make([]map[string]interface{},0) err := json.Unmarshal(JsonBytes, &dataSlice) if err != nil{ fmt.Printf("反序列化失败,err=",err) return } fmt.Println(dataSlice) }
标签:ret return 中华 失败 span inter nbsp pre str
原文地址:https://www.cnblogs.com/paad/p/11260948.html