optimize unit test & add document

This commit is contained in:
anqiansong
2020-08-16 23:28:01 +08:00
parent 790b29b8eb
commit dbc034c9eb
46 changed files with 735 additions and 1855 deletions

View File

@@ -2,17 +2,12 @@ package gen
import (
"github.com/tal-tech/go-zero/tools/goctl/model/sql/template"
"github.com/tal-tech/go-zero/tools/goctl/util/templatex"
)
func genImports(withCache bool) (string, error) {
output, err := templatex.With("import").
Parse(template.Imports).
Execute(map[string]interface{}{
"withCache": withCache,
})
if err != nil {
return "", err
func genImports(withCache bool) string {
if withCache {
return template.Imports
} else {
return template.ImportsNoCache
}
return output.String(), nil
}