【发布时间】:2015-08-21 06:16:23
【问题描述】:
type NetworkInterface struct {
Gateway string `json:"gateway"`
IPAddress string `json:"ip"`
IPPrefixLen int `json:"ip_prefix_len"`
MacAddress string `json:"mac"`
...
}
我很困惑反引号中内容的功能是什么,例如json:"gateway"。
只是评论吗,比如//this is the gateway?
【问题讨论】:
-
JSON 当然是多产的。 json 库在序列化和反序列化时不处理最普遍的样式(驼峰式)的大小写转换,没有这种 asinine hack,真是不可原谅。
标签: go