Fork me on GitHub

Go里的JSON

json.Marshal(x)
json.MarshalIndent(x, "", "  ")

tag 
`json:"xxxx,omitempty"`
omitempty表示如果只为零值或者空,则不输出这个成员到JSON中
posted @ 2021-10-26 19:27  myboran  阅读(43)  评论(0)    收藏  举报