diff --git a/sql2go/parser.go b/sql2go/parser.go index f066996..5ee2bfa 100644 --- a/sql2go/parser.go +++ b/sql2go/parser.go @@ -127,7 +127,7 @@ func generateTable(tableName string, modelStructName string, columnList []*sqlpa // TableName 获取表名称 func ({{TABLE_FIRST}} {{TABLE_STRUCT_NAME}}) TableName() string { - return "{{TABLE_NAME}}" +return "{{TABLE_NAME}}" }` replaceTable := map[string]string{ "{{TABLE_FIRST}}": tableFirst, @@ -171,22 +171,22 @@ func generateTableColumnDefined(modelStructName string, columnList []*sqlparser. structFieldCommentDefine = strings.ReplaceAll(structFieldCommentDefine, k, v) } structFieldResult += structFieldDefine + "\n" - structFieldDescInstanceResult += " " + structFieldDescDefine + ",\n" - structFieldCommentInstanceResult += " " + structFieldCommentDefine + ",\n" + structFieldDescInstanceResult += structFieldDescDefine + ",\n" + structFieldCommentInstanceResult += structFieldCommentDefine + ",\n" } structFieldResult += "}" - structFieldDescInstanceResult += " }" - structFieldCommentInstanceResult += " }" + structFieldDescInstanceResult += "}" + structFieldCommentInstanceResult += "}" tableColumnFunction := ` // Columns 获取表字段定义 func ({TABLE_FIRST} {MODEL_STRUCT_NAME}) Columns() *{COLUMN_DEFINED} { - return {STRUCT_FIELD_DESC_DEFINED_RESULT} +return {STRUCT_FIELD_DESC_DEFINED_RESULT} } // ColumnComment 获取表字段描述 func ({TABLE_FIRST} {MODEL_STRUCT_NAME}) ColumnComment() map[string]string { - return {STRUCT_FIELD_COMMENT_DEFINED_RESULT} +return {STRUCT_FIELD_COMMENT_DEFINED_RESULT} } ` dataMap := map[string]string{