https://blog.csdn.net/qq_39728668/article/details/100159712
re := new(User)
db := c.DB().Table(c.TableName()).
Where(“user_id = ?”, c.User)
err = db.First(&re).Error
如果不通过new关键字实例化就会报错
unsupported destination, should be slice or struct
[转] gorm : unsupported destination, should be slice or struct原因
最新推荐文章于 2022-10-22 13:36:24 发布