mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-02-03 00:38:40 +08:00
fix the package name of grpc client (#1170)
* fix the package name of grpc client * Remove k8s/utils Co-authored-by: anqiansong <anqiansong@bytedance.com>
This commit is contained in:
parent
68acfb1891
commit
bef5bd4e4f
@ -8,7 +8,6 @@ import (
|
|||||||
"github.com/tal-tech/go-zero/tools/goctl/rpc/parser"
|
"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"
|
||||||
"github.com/tal-tech/go-zero/tools/goctl/util/ctx"
|
"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"
|
"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)
|
inner := make(map[string]Dir)
|
||||||
etcDir := filepath.Join(ctx.WorkDir, "etc")
|
etcDir := filepath.Join(ctx.WorkDir, "etc")
|
||||||
internalDir := filepath.Join(ctx.WorkDir, "internal")
|
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")
|
serverDir := filepath.Join(internalDir, "server")
|
||||||
svcDir := filepath.Join(internalDir, "svc")
|
svcDir := filepath.Join(internalDir, "svc")
|
||||||
pbDir := filepath.Join(ctx.WorkDir, proto.GoPackage)
|
pbDir := filepath.Join(ctx.WorkDir, proto.GoPackage)
|
||||||
sName, err := format.FileNamingFormat(cfg.NamingFormat, proto.Service.Name)
|
callDir := filepath.Join(ctx.WorkDir, strings.ToLower(stringx.From(proto.Service.Name).ToCamel()))
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
callDir := filepath.Join(ctx.WorkDir, sName)
|
|
||||||
if strings.EqualFold(proto.Service.Name, proto.GoPackage) {
|
if strings.EqualFold(proto.Service.Name, proto.GoPackage) {
|
||||||
clientDir, err := format.FileNamingFormat(cfg.NamingFormat, proto.Service.Name+"_client")
|
callDir = filepath.Join(ctx.WorkDir, strings.ToLower(stringx.From(proto.Service.Name+"_client").ToCamel()))
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
callDir = filepath.Join(ctx.WorkDir, clientDir)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inner[wd] = Dir{
|
inner[wd] = Dir{
|
||||||
|
Loading…
Reference in New Issue
Block a user