From 1e720ff9a3ad9cbbd27a05997b20fea5dd7184f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Sun, 14 Apr 2024 21:46:43 +0800 Subject: [PATCH] tpl format --- sql2go/parser.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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{