From bef5bd4e4f3bdc4da7a3ad732e3a1ff6189debca Mon Sep 17 00:00:00 2001 From: anqiansong Date: Sat, 30 Oct 2021 21:35:05 +0800 Subject: [PATCH] fix the package name of grpc client (#1170) * fix the package name of grpc client * Remove k8s/utils Co-authored-by: anqiansong --- tools/goctl/rpc/generator/mkdir.go | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/tools/goctl/rpc/generator/mkdir.go b/tools/goctl/rpc/generator/mkdir.go index 9525563d..dd39d684 100644 --- a/tools/goctl/rpc/generator/mkdir.go +++ b/tools/goctl/rpc/generator/mkdir.go @@ -8,7 +8,6 @@ import ( "github.com/tal-tech/go-zero/tools/goctl/rpc/parser" "github.com/tal-tech/go-zero/tools/goctl/util" "github.com/tal-tech/go-zero/tools/goctl/util/ctx" - "github.com/tal-tech/go-zero/tools/goctl/util/format" "github.com/tal-tech/go-zero/tools/goctl/util/stringx" ) @@ -52,7 +51,7 @@ type ( } ) -func mkdir(ctx *ctx.ProjectContext, proto parser.Proto, cfg *conf.Config) (DirContext, error) { +func mkdir(ctx *ctx.ProjectContext, proto parser.Proto, _ *conf.Config) (DirContext, error) { inner := make(map[string]Dir) etcDir := filepath.Join(ctx.WorkDir, "etc") internalDir := filepath.Join(ctx.WorkDir, "internal") @@ -61,19 +60,9 @@ func mkdir(ctx *ctx.ProjectContext, proto parser.Proto, cfg *conf.Config) (DirCo serverDir := filepath.Join(internalDir, "server") svcDir := filepath.Join(internalDir, "svc") pbDir := filepath.Join(ctx.WorkDir, proto.GoPackage) - sName, err := format.FileNamingFormat(cfg.NamingFormat, proto.Service.Name) - if err != nil { - return nil, err - } - - callDir := filepath.Join(ctx.WorkDir, sName) + callDir := filepath.Join(ctx.WorkDir, strings.ToLower(stringx.From(proto.Service.Name).ToCamel())) if strings.EqualFold(proto.Service.Name, proto.GoPackage) { - clientDir, err := format.FileNamingFormat(cfg.NamingFormat, proto.Service.Name+"_client") - if err != nil { - return nil, err - } - - callDir = filepath.Join(ctx.WorkDir, clientDir) + callDir = filepath.Join(ctx.WorkDir, strings.ToLower(stringx.From(proto.Service.Name+"_client").ToCamel())) } inner[wd] = Dir{