mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-05-08 15:39:59 +08:00
optimize unit test & add document
This commit is contained in:
@@ -8,7 +8,7 @@ import (
|
||||
"github.com/tal-tech/go-zero/tools/goctl/util/templatex"
|
||||
)
|
||||
|
||||
func genInsert(table Table) (string, error) {
|
||||
func genInsert(table Table, withCache bool) (string, error) {
|
||||
expressions := make([]string, 0)
|
||||
expressionValues := make([]string, 0)
|
||||
for _, filed := range table.Fields {
|
||||
@@ -26,6 +26,7 @@ func genInsert(table Table) (string, error) {
|
||||
output, err := templatex.With("insert").
|
||||
Parse(template.Insert).
|
||||
Execute(map[string]interface{}{
|
||||
"withCache": withCache,
|
||||
"upperStartCamelObject": camel,
|
||||
"lowerStartCamelObject": stringx.From(camel).LowerStart(),
|
||||
"expression": strings.Join(expressions, ", "),
|
||||
|
||||
Reference in New Issue
Block a user