expected ';', found 'IDENT' string (and 1 more errors)-package model #23
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Author: @GameXG
如上,reverse 报这个错误。
已经删除了 go-xorm 所有代码并重新 go get ,并重新将 go-xorm/cmd/templates 重新拷贝到当前目录。还是报这个错误。
我检查下代码看看能不能找到原因。
Author: @GameXG
找到原因,数据库字段存在空格时就挂了。
数据库有个expected price 字段,转换出来的go字段名是 Expected price ,直接挂了。
Author: @GameXG
tpl 里面调用了 Mapper 转换字段名,替换掉 Mapper 函数将空格替换为 _ 。
go-xorm\cmd\xorm\go.go 文件设置了 tag,可以在这里增加指定字段名,当判断到 Mapper 后的和原始值不一致时强制指定字段名。
这样可以在cmd里面解决,但是感觉并不好,xorm 其他部分呢也有可能碰到这个问题。
预期 col.Name 是保存数据库原始字段名还是处理后的字段名?
我看到存在 col.FiedName ,这个计划是保存原始字段名?不过我测试mssql驱动下为空。
Author: @iGitHubJ
我也遇到了这个错误,请问大神们怎么解决?
Author: @Keleir
Met same question: