```
package main
import "fmt"
import "encoding/json"
func main() {
json_list_str := `[{"ID":"7fab2946-9d9c-39d0-387e-a0239cf95351","Node":"consul-4","Address":"192.168.15.113","Datacenter":"dc1","TaggedAddresses":{"lan":"192.168.15.113","wan":"192.168.15.113"},"NodeMeta":{"consul-network-segment":""},"ServiceKind":"","ServiceID":"web4","ServiceName":"web4","ServiceTags":["master"],"ServiceAddress":"192.168.15.113","ServiceWeights":{"Passing":1,"Warning":1},"ServiceMeta":{},"ServicePort":8082,"ServiceEnableTagOverride":false,"ServiceProxyDestination":"","ServiceProxy":{},"ServiceConnect":{},"CreateIndex":2974,"ModifyIndex":2974}]`
var result []interface{}
err := json.Unmarshal([]byte(json_list_str), &result)
fmt.Println(result)
//todo 如何将“Address”取出?
}
```
更多评论
```
var result map[string]interface{}
err := json.Unmarshal([]byte(json_list_str), &result)
fmt.Println(err, result)
```
提示报错了。
json: cannot unmarshal array into Go value of type map[string]interface {} map[]
在线代码执行链接 https://www.bytelang.com/o/s/c/c9YRSqkXPFs=
#3