|
@@ -31,20 +31,20 @@ func RawFieldNames(in interface{}, postgresSql ...bool) []string {
|
|
// gets us a StructField
|
|
// gets us a StructField
|
|
fi := typ.Field(i)
|
|
fi := typ.Field(i)
|
|
tagv := fi.Tag.Get(dbTag)
|
|
tagv := fi.Tag.Get(dbTag)
|
|
- switch {
|
|
|
|
- case tagv == "-":
|
|
|
|
|
|
+ switch tagv {
|
|
|
|
+ case "-":
|
|
continue
|
|
continue
|
|
- case tagv != "":
|
|
|
|
|
|
+ case "":
|
|
if pg {
|
|
if pg {
|
|
- out = append(out, tagv)
|
|
|
|
|
|
+ out = append(out, fi.Name)
|
|
} else {
|
|
} else {
|
|
- out = append(out, fmt.Sprintf("`%s`", tagv))
|
|
|
|
|
|
+ out = append(out, fmt.Sprintf("`%s`", fi.Name))
|
|
}
|
|
}
|
|
default:
|
|
default:
|
|
if pg {
|
|
if pg {
|
|
- out = append(out, fi.Name)
|
|
|
|
|
|
+ out = append(out, tagv)
|
|
} else {
|
|
} else {
|
|
- out = append(out, fmt.Sprintf("`%s`", fi.Name))
|
|
|
|
|
|
+ out = append(out, fmt.Sprintf("`%s`", tagv))
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|