From 3285436f757a22fe46cf832a38ec311840babcc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=87=E6=9D=B0?= <1541683150@qq.com> Date: Wed, 13 Jan 2021 18:07:31 +0800 Subject: [PATCH] f-fix spell (#381) Co-authored-by: chenwenjie --- tools/goctl/model/sql/gen/insert.go | 6 +++--- tools/goctl/model/sql/gen/template.go | 4 ++-- tools/goctl/model/sql/gen/update.go | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tools/goctl/model/sql/gen/insert.go b/tools/goctl/model/sql/gen/insert.go index 139e9c1b..e6ff7cbc 100644 --- a/tools/goctl/model/sql/gen/insert.go +++ b/tools/goctl/model/sql/gen/insert.go @@ -22,12 +22,12 @@ func genInsert(table Table, withCache bool) (string, string, error) { expressions := make([]string, 0) expressionValues := make([]string, 0) - for _, filed := range table.Fields { - camel := filed.Name.ToCamel() + for _, field := range table.Fields { + camel := field.Name.ToCamel() if camel == "CreateTime" || camel == "UpdateTime" { continue } - if filed.IsPrimaryKey && table.PrimaryKey.AutoIncrement { + if field.IsPrimaryKey && table.PrimaryKey.AutoIncrement { continue } expressions = append(expressions, "?") diff --git a/tools/goctl/model/sql/gen/template.go b/tools/goctl/model/sql/gen/template.go index aed221fe..65e3a38f 100644 --- a/tools/goctl/model/sql/gen/template.go +++ b/tools/goctl/model/sql/gen/template.go @@ -12,12 +12,12 @@ const ( category = "model" deleteTemplateFile = "delete.tpl" deleteMethodTemplateFile = "interface-delete.tpl" - fieldTemplateFile = "filed.tpl" + fieldTemplateFile = "field.tpl" findOneTemplateFile = "find-one.tpl" findOneMethodTemplateFile = "interface-find-one.tpl" findOneByFieldTemplateFile = "find-one-by-field.tpl" findOneByFieldMethodTemplateFile = "interface-find-one-by-field.tpl" - findOneByFieldExtraMethodTemplateFile = "find-one-by-filed-extra-method.tpl" + findOneByFieldExtraMethodTemplateFile = "find-one-by-field-extra-method.tpl" importsTemplateFile = "import.tpl" importsWithNoCacheTemplateFile = "import-no-cache.tpl" insertTemplateFile = "insert.tpl" diff --git a/tools/goctl/model/sql/gen/update.go b/tools/goctl/model/sql/gen/update.go index 3eca4135..6e854167 100644 --- a/tools/goctl/model/sql/gen/update.go +++ b/tools/goctl/model/sql/gen/update.go @@ -10,12 +10,12 @@ import ( func genUpdate(table Table, withCache bool) (string, string, error) { expressionValues := make([]string, 0) - for _, filed := range table.Fields { - camel := filed.Name.ToCamel() + for _, field := range table.Fields { + camel := field.Name.ToCamel() if camel == "CreateTime" || camel == "UpdateTime" { continue } - if filed.IsPrimaryKey { + if field.IsPrimaryKey { continue } expressionValues = append(expressionValues, "data."+camel)