2022 年 3 月
-
[记录]关于新增新字段sqlx报错missing destination name
正常情况下,将数据的字段映射到一个struct的时候,需要使用db这个tag指定关系,典型的使用场景如下: type News struct { Id int64 `json:"id" db:"id"` GroupId int64 `json:"group_id" db:"group_id"` } news := &News{} err := db.QueryRowx("select...", x…