将结构体对应字段类型设为指针类型,一劳永逸,不用担心json序列化与反序列化问题
type ArticleDetail struct {
ArticleInfo
Content *string `db:"content"`
}
关于go数据表查询结构体对应字段null问题(sqlx converting NULL to string is unsupported)
最新推荐文章于 2021-12-22 18:10:43 发布
将结构体对应字段类型设为指针类型,一劳永逸,不用担心json序列化与反序列化问题
type ArticleDetail struct {
ArticleInfo
Content *string `db:"content"`
}