[转] gorm : unsupported destination, should be slice or struct原因

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

发布了3 篇原创文章 · 获赞 0 · 访问量 90

猜你喜欢

转载自blog.csdn.net/wccms/article/details/104785316