From c4f8eca459f1574952e393176637c9ce01ca3260 Mon Sep 17 00:00:00 2001 From: chowyu12 <81024796+chowyu12@users.noreply.github.com> Date: Fri, 23 Dec 2022 23:57:56 +0800 Subject: [PATCH] Feat update rootpkg (#2718) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add go-grpc_opt and go_opt for grpc new command * feat: remove log when disable log * feat: remove repeat code Co-authored-by: zhouyy --- tools/goctl/api/gogen/genhandlers.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/tools/goctl/api/gogen/genhandlers.go b/tools/goctl/api/gogen/genhandlers.go index eae2c2fd..fa1093ec 100644 --- a/tools/goctl/api/gogen/genhandlers.go +++ b/tools/goctl/api/gogen/genhandlers.go @@ -8,7 +8,6 @@ import ( "github.com/zeromicro/go-zero/tools/goctl/api/spec" "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/format" "github.com/zeromicro/go-zero/tools/goctl/util/pathx" @@ -41,14 +40,10 @@ func genHandler(dir, rootPkg string, cfg *config.Config, group spec.Group, route handler = strings.Title(handler) logicName = pkgName } - parentPkg, err := golang.GetParentPackage(dir) - if err != nil { - return err - } return doGenToFile(dir, handler, cfg, group, route, handlerInfo{ PkgName: pkgName, - ImportPackages: genHandlerImports(group, route, parentPkg), + ImportPackages: genHandlerImports(group, route, rootPkg), HandlerName: handler, RequestType: util.Title(route.RequestTypeName()), LogicName: logicName,