Go语言中文网 为您找到相关结果 1

golang simplejson 使用笔记

第一步,得到json的内容 contents, _ := ioutil.ReadAll(res.Body) js, js_err := simplejson.NewJson(contents) 第二部,根据json的格式,选择使用array或者map储存数据 var nodes = make(map[string]interface{}) nodes, _ = js.Map() 第三步,将nodes当作map处理即可,如果map的value仍是一个json机构,回到第二步。 for key,_ := range nodes { ... ...阅读全文

博文 2015-06-17 20:17:46 iluckyning