go-admin
go-admin copied to clipboard
FIX sql 1.7.1 bug
go-sql-driver 1.7.1 新版本返回菜单id数据为[]uint8,将其转换为int解决问题
👍
看群主还没合代码,建议先退回 mysql v1.5.0 版本
- [go get -u github.com/go-sql-driver/[email protected] ]
- [go mod tidy]
根本原因是mysql驱动从1.7.0增加了unsigned int类型的返回
return unsigned in database type name when necessary (https://github.com/go-sql-driver/mysql/pull/1238)
考虑修改 https://github.com/GoAdminGroup/go-admin/blob/master/modules/db/converter.go#L12C6-L12C19 的SetColVarType,将所有unsigned int都用int64去scan才能解决根本问题