指定json中的key名字:

指定数据类型, string number, boolean

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

忽略字段 "-" (无论有没有值, 都忽略)

 

type user struct {

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

}

相关文章:

  • 2021-10-09
  • 2021-08-11
  • 2022-01-06
  • 2022-12-23
  • 2021-08-18
  • 2022-02-16
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-10-16
  • 2021-06-13
  • 2022-12-23
  • 2022-01-18
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案