Skip to content

Commit 7825690

Browse files
author
陈奎
committed
feat(tml):better support nullable field
1 parent 6b91112 commit 7825690

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

template.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,9 @@ func getTag(mapper names.Mapper, genJson bool, genXorm bool, otherTags []string)
302302
if genJson {
303303
tags = append(tags, "json:\""+jsonName+"\"")
304304
}
305+
if len(res) > 0 && genXorm {
306+
tags = append(tags, "xorm:\""+strings.Join(res, " ")+"\"")
307+
}
305308
if len(otherTags) != 0 {
306309
for _, t := range otherTags {
307310
if t == "json" {
@@ -310,9 +313,6 @@ func getTag(mapper names.Mapper, genJson bool, genXorm bool, otherTags []string)
310313
tags = append(tags, fmt.Sprintf("%s:\"%s\"", t, jsonName))
311314
}
312315
}
313-
if len(res) > 0 && genXorm {
314-
tags = append(tags, "xorm:\""+strings.Join(res, " ")+"\"")
315-
}
316316
if len(tags) > 0 {
317317
return "`" + strings.Join(tags, " ") + "`"
318318
} else {

0 commit comments

Comments
 (0)