未验证 提交 b86cf22f 编写于 作者: M Ming Deng 提交者: GitHub

Merge pull request #4210 from flycash/adt/all

Move pr 3784
...@@ -330,6 +330,8 @@ func (o *rawSet) QueryRow(containers ...interface{}) error { ...@@ -330,6 +330,8 @@ func (o *rawSet) QueryRow(containers ...interface{}) error {
return err return err
} }
structTagMap := make(map[reflect.StructTag]map[string]string)
defer rows.Close() defer rows.Close()
if rows.Next() { if rows.Next() {
...@@ -396,7 +398,12 @@ func (o *rawSet) QueryRow(containers ...interface{}) error { ...@@ -396,7 +398,12 @@ func (o *rawSet) QueryRow(containers ...interface{}) error {
recursiveSetField(f) recursiveSetField(f)
} }
_, tags := parseStructTag(fe.Tag.Get(defaultStructTagName)) // thanks @Gazeboxu.
tags := structTagMap[fe.Tag]
if tags == nil {
_, tags = parseStructTag(fe.Tag.Get(defaultStructTagName))
structTagMap[fe.Tag] = tags
}
var col string var col string
if col = tags["column"]; col == "" { if col = tags["column"]; col == "" {
col = nameStrategyMap[nameStrategy](fe.Name) col = nameStrategyMap[nameStrategy](fe.Name)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册