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,