Go gorm踩过的坑

使用gorm.Model后无法查询数据

Scan error on column index 1, name “created_at”

提示:Scan error on column index 1, name “created_at”: unsupported Scan, storing driver.Value type []uint8
解决办法:
打开数据库的时候加上parseTime=true

root:123456@tcp(127.0.0.1:3306)/mapdb?charset=utf8&parseTime=true
发布了131 篇原创文章 · 获赞 81 · 访问量 7万+

猜你喜欢

转载自blog.csdn.net/wei242425445/article/details/99202062