fix: quickstart wrong package when go.mod exists in parent dir (#2048)

* chore: fix typo

* fix: quickstart in dir with go.mod

* fix: runner failed

* chore: refine code

* chore: simplify quickstart mono
This commit is contained in:
Kevin Wan
2022-06-26 22:37:15 +08:00
committed by GitHub
parent 630dfa0887
commit 555c4ecd1a
11 changed files with 111 additions and 75 deletions

View File

@@ -18,6 +18,7 @@ import (
"github.com/zeromicro/go-zero/tools/goctl/api/parser"
apiutil "github.com/zeromicro/go-zero/tools/goctl/api/util"
"github.com/zeromicro/go-zero/tools/goctl/config"
"github.com/zeromicro/go-zero/tools/goctl/pkg/golang"
"github.com/zeromicro/go-zero/tools/goctl/util"
"github.com/zeromicro/go-zero/tools/goctl/util/pathx"
)
@@ -85,7 +86,7 @@ func DoGenProject(apiFile, dir, style string) error {
}
logx.Must(pathx.MkdirIfNotExist(dir))
rootPkg, err := getParentPackage(dir)
rootPkg, err := golang.GetParentPackage(dir)
if err != nil {
return err
}