{"ip":"192.168.1.1","country":"XX","area":"","region":"XX","city":"内网IP","county":"内网IP","isp":"内网IP","country_id":"xx","area_id":"","region_id":"xx","city_id":"local","county_id":"local","isp_id":"local"}
![QQ截图20180326191356.jpg](https://static.studygolang.com/180326/8538987c4fb06f09e3f465a7aef6a303.jpg)
如图,我想解析JSON,但不想用原本的字段名,网上查了下,找到了如图中,后面追加json格式方法,但是并不管用,
只解析出了ip,city
不应该类似:
```go
type IpBody struct {
Ip string `json:"ip"`
Province string `json:"region"`
}
```
吗?
#1
更多评论
<a href="/user/polaris" title="@polaris">@polaris</a> 你这试了是对的,谢谢了,网上各种帖子蛮害人的
#2