add runner

This commit is contained in:
kim
2020-08-08 15:16:59 +08:00
committed by Kevin Wan
parent 760d3c8c4b
commit b1e8dd62da
8 changed files with 25 additions and 16 deletions

View File

@@ -10,6 +10,7 @@ import (
"zero/tools/goctl/api/spec"
"zero/tools/goctl/api/util"
"zero/tools/goctl/vars"
)
const mainTemplate = `package main
@@ -74,8 +75,8 @@ func genMain(dir string, api *spec.ApiSpec) error {
func genMainImports(parentPkg string) string {
imports := []string{
`"zero/core/conf"`,
`"zero/rest"`,
fmt.Sprintf("\"%s/core/conf\"", vars.ProjectOpenSourceUrl),
fmt.Sprintf("\"%s/rest\"", vars.ProjectOpenSourceUrl),
}
imports = append(imports, fmt.Sprintf("\"%s\"", path.Join(parentPkg, configDir)))
imports = append(imports, fmt.Sprintf("\"%s\"", path.Join(parentPkg, handlerDir)))