栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Go语言

cannot use column (type Column) as type gorm.ColumnType in append

Go语言 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

cannot use column (type Column) as type gorm.ColumnType in append

golang 运行时报错:

# gorm.io/driver/postgres
C:UsersAdministratorgopkgmodgorm.iodriverpostgres@v1.2.2migrator.go:337:24: cannot use column (type Column) as type gorm.ColumnType in append:
        Column does not implement gorm.ColumnType (missing AutoIncrement method)
# gorm.io/driver/sqlserver
C:UsersAdministratorgopkgmodgorm.iodriversqlserver@v1.2.1create.go:55:33: not enough arguments in call to field.ValueOf
        have (reflect.Value)
        want (context.Context, reflect.Value)
C:UsersAdministratorgopkgmodgorm.iodriversqlserver@v1.2.1create.go:61:35: not enough arguments in call to field.ValueOf
        have (reflect.Value)
        want (context.Context, reflect.Value)

其实时casbinv2依赖了postgres和sqlserver包,实际上它也仅仅是判断了一下DB的类型,没真正用上,因为我用的是mysql呀。

但是很傻逼,他就会报错,查了一圈,其实是版本bug:

	gorm.io/driver/postgres v1.2.2 // indirect
	gorm.io/driver/sqlserver v1.2.1 // indirect

这里两个版本会由bug
升级一下:

	gorm.io/driver/postgres v1.3.1 // indirect
	gorm.io/driver/sqlserver v1.3.1 // indirect

升级了就报错了,好像第二次遇到go的依赖有这些bug了

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/902795.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号