From 77482c8946a90a1ef0f93817cfe4ff7ac3dedc26 Mon Sep 17 00:00:00 2001 From: anqiansong Date: Tue, 8 Feb 2022 22:16:38 +0800 Subject: [PATCH] fixes typo (#1511) Co-authored-by: anqiansong --- tools/goctl/rpc/cli/zrpc.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tools/goctl/rpc/cli/zrpc.go b/tools/goctl/rpc/cli/zrpc.go index b1935c9d..37b6e3de 100644 --- a/tools/goctl/rpc/cli/zrpc.go +++ b/tools/goctl/rpc/cli/zrpc.go @@ -8,10 +8,10 @@ import ( "strings" "github.com/emicklei/proto" + "github.com/urfave/cli" "github.com/zeromicro/go-zero/tools/goctl/rpc/generator" "github.com/zeromicro/go-zero/tools/goctl/util" "github.com/zeromicro/go-zero/tools/goctl/util/pathx" - "github.com/urfave/cli" ) var ( @@ -75,18 +75,18 @@ func ZRPC(c *cli.Context) error { } goOut = removePluginFlag(goOut) - goOut, err = parseOutOut(src, goOut, goOpt, goPackage) + goOut, err = parseOut(src, goOut, goOpt, goPackage) if err != nil { return err } - var isGoolePlugin = len(grpcOut) > 0 + var isGooglePlugin = len(grpcOut) > 0 // If grpcOut is not empty means that user generates grpc code by // https://google.golang.org/protobuf/cmd/protoc-gen-go and // https://google.golang.org/grpc/cmd/protoc-gen-go-grpc, // for details please see https://grpc.io/docs/languages/go/quickstart/ - if isGoolePlugin { - grpcOut, err = parseOutOut(src, grpcOut, grpcOpt, goPackage) + if isGooglePlugin { + grpcOut, err = parseOut(src, grpcOut, grpcOpt, goPackage) if err != nil { return err } @@ -109,7 +109,7 @@ func ZRPC(c *cli.Context) error { return err } - if isGoolePlugin && grpcOut != goOut { + if isGooglePlugin && grpcOut != goOut { return fmt.Errorf("the --go_out and --go-grpc_out must be the same") } @@ -136,9 +136,9 @@ func ZRPC(c *cli.Context) error { return g.Generate(source, zrpcOut, nil) } -// parseOutOut calculates the output place to grpc code, about to calculate logic for details +// parseOut calculates the output place to grpc code, about to calculate logic for details // please see https://developers.google.com/protocol-buffers/docs/reference/go-generated#invocation. -func parseOutOut(sourceDir, grpcOut, grpcOpt, goPackage string) (string, error) { +func parseOut(sourceDir, grpcOut, grpcOpt, goPackage string) (string, error) { if !filepath.IsAbs(grpcOut) { grpcOut = filepath.Join(sourceDir, grpcOut) }