Use pointer syntax for TableName()
This commit is contained in:
@@ -175,7 +175,7 @@ func generateColsVarBlock(si *structInfo) string {
|
||||
}
|
||||
b.WriteString("}{\n")
|
||||
for _, f := range si.Fields {
|
||||
b.WriteString(fmt.Sprintf("\t%s: gormcol.Field{Table: (%s{}).TableName(), Column: %q},\n", f.GoName, si.Name, f.ColName))
|
||||
b.WriteString(fmt.Sprintf("\t%s: gormcol.Field{Table: (&%s{}).TableName(), Column: %q},\n", f.GoName, si.Name, f.ColName))
|
||||
}
|
||||
b.WriteString("}\n")
|
||||
return b.String()
|
||||
|
||||
Reference in New Issue
Block a user