“ }, // … , “101285033290986”:{ “id”:“101285033290986”, “关于”: ” 聪明 </跨度> 市 </跨度> 世博会世界大会“, “元数据”:{ “田地”:[ { “名字”:“id锟
将map转换为struct:
import "github.com/mitchellh/mapstructure" mapstructure.Decode(myMap, &myStruct)
例
但我会这样做:
type Page struct { ID string `json:"id"` About string `json:"about"` //other fields and nested structs like your metadata struct } type fbPages map[string]Page