Skip to content

Commit

Permalink
chore: refactor code (zeromicro#1613)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevwan authored Mar 4, 2022
1 parent 3b7ca86 commit b939ce7
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions core/stores/builder/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,20 @@ func RawFieldNames(in interface{}, postgresSql ...bool) []string {
// gets us a StructField
fi := typ.Field(i)
tagv := fi.Tag.Get(dbTag)
switch {
case tagv == "-":
switch tagv {
case "-":
continue
case tagv != "":
case "":
if pg {
out = append(out, tagv)
out = append(out, fi.Name)
} else {
out = append(out, fmt.Sprintf("`%s`", tagv))
out = append(out, fmt.Sprintf("`%s`", fi.Name))
}
default:
if pg {
out = append(out, fi.Name)
out = append(out, tagv)
} else {
out = append(out, fmt.Sprintf("`%s`", fi.Name))
out = append(out, fmt.Sprintf("`%s`", tagv))
}
}
}
Expand Down

0 comments on commit b939ce7

Please sign in to comment.