您的结构字段不会导出。这是因为它们以小写字母开头。
EntryCount // <--- ExportedentryCount // <--- Not exported
当我说“未导出”时,是指它们在您的包装之外不可见。您的软件包可以愉快地访问它们,因为它们在本地作用域内。
至于
encoding/json包装-它看不到它们。您需要通过使所有字段
encoding/json都以大写字母开头,从而使它们对包可见,从而导出它们:
type Status struct { Status string Node_id string}type meta struct { To string From string Id string EntryCount int64 Size int64 Depricated bool}type Mydata struct { metadata meta Status []Status}[See it working on the Go Playgroundhere](http://play.golang.org/p/adZgg_x4j3)
您还应该参考Golang规范以获得答案。具体来说,是有关导出的标识符的部分。



