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

cannot use column (type Column) as type gorm.ColumnType in append,第1张

golang 运行时报错:

# gorm.io/driver/postgres
C:\Users\Administrator\go\pkg\mod\gorm.io\driver\postgres@v1.2.2\migrator.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:\Users\Administrator\go\pkg\mod\gorm.io\driver\sqlserver@v1.2.1\create.go:55:33: not enough arguments in call to field.ValueOf
        have (reflect.Value)
        want (context.Context, reflect.Value)
C:\Users\Administrator\go\pkg\mod\gorm.io\driver\sqlserver@v1.2.1\create.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了

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/989798.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-21
下一篇 2022-05-21

发表评论

登录后才能评论

评论列表(0条)

保存