go中json的tag使用

指定json中的key名字:json

指定数据类型, string number, booleanstring

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

忽略字段 "-" (不管有没有值, 都忽略)数据类型

 

type user struct {数据

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

}