support api templates
This commit is contained in:
@@ -2,12 +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"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/templatex"
|
||||
)
|
||||
|
||||
func genImports(withCache, timeImport bool) (string, error) {
|
||||
if withCache {
|
||||
buffer, err := util.With("import").Parse(template.Imports).Execute(map[string]interface{}{
|
||||
buffer, err := templatex.With("import").Parse(template.Imports).Execute(map[string]interface{}{
|
||||
"time": timeImport,
|
||||
})
|
||||
if err != nil {
|
||||
@@ -15,7 +15,7 @@ func genImports(withCache, timeImport bool) (string, error) {
|
||||
}
|
||||
return buffer.String(), nil
|
||||
} else {
|
||||
buffer, err := util.With("import").Parse(template.ImportsNoCache).Execute(map[string]interface{}{
|
||||
buffer, err := templatex.With("import").Parse(template.ImportsNoCache).Execute(map[string]interface{}{
|
||||
"time": timeImport,
|
||||
})
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user