go中json的tag使用

指定json中的key名字:json

指定數據類型, string number, booleanstring

忽略空值(值不爲空, 不忽略)it

忽略字段 "-" (不管有沒有值, 都忽略)數據類型

 

type user struct {數據

  Id int64 `json:"id,string,omitempty"`struct

}

相關文章
相關標籤/搜索