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原因
猜你喜欢
转载自blog.csdn.net/wccms/article/details/104785316
今日推荐
周排行