goframe2.9升级报错处理

goframe2.9升级报错处理

直接github下载goframe命令行工具Releases · gogf/gf

然后安装.

运行goframe项目,如果有报错提示net\ghttp\ghttp_server.go:300:9: table.SetHeader undefined (type *tablewriter.Table has no field or method SetHeader) ….\net\ghttp\ghttp_server.go:301:9: table.SetRowLine undefined (type *tablewriter.Table has no field or method SetRowLine) ….\net\ghttp\ghttp_server.go:302:9: table.SetBorder undefined (type *tablewriter.Table has no field or method SetBorder) ….\net\ghttp\ghttp_server.go:303:9: table.SetCenterSeparator undefined (type *tablewriter.Table has no field or method SetCenterSeparator)

在项目所在目录打开管理员命令行:(FOR /F “tokens=*” %G IN (‘go list -m -f “{{if and .Indirect (not .Main)}}{{.Path}}{{end}}” all’) DO @go mod edit -droprequire=%G) & go mod tidy

如果报错信息如下:

go: can’t compute ‘all’ using the vendor directory (Use -mod=mod or -mod=readonly to bypass.)

则执行:

(FOR /F “tokens=*” %G IN (‘go list -mod=mod -m -f “{{if and .Indirect (not .Main)}}{{.Path}}{{end}}” all’) DO @go mod edit -droprequire=%G) & go mod tidy

© 版权声明
THE END
喜欢就支持一下吧
点赞14 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容