From 4e51b25f11a7a4a295e284e2a82bfe6a52966940 Mon Sep 17 00:00:00 2001 From: songzhibin97 <49082129+songzhibin97@users.noreply.github.com> Date: Sun, 22 May 2022 09:44:18 +0800 Subject: [PATCH] Update server.go (#2027) --- cmd/kratos/internal/proto/server/server.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/cmd/kratos/internal/proto/server/server.go b/cmd/kratos/internal/proto/server/server.go index b5707dac5..0ac7355fb 100644 --- a/cmd/kratos/internal/proto/server/server.go +++ b/cmd/kratos/internal/proto/server/server.go @@ -63,12 +63,13 @@ func run(cmd *cobra.Command, args []string) { } for _, e := range s.Elements { r, ok := e.(*proto.RPC) - if ok { - cs.Methods = append(cs.Methods, &Method{ - Service: s.Name, Name: caser.String(r.Name), Request: r.RequestType, - Reply: r.ReturnsType, Type: getMethodType(r.StreamsRequest, r.StreamsReturns), - }) + if !ok { + continue } + cs.Methods = append(cs.Methods, &Method{ + Service: s.Name, Name: caser.String(r.Name), Request: r.RequestType, + Reply: r.ReturnsType, Type: getMethodType(r.StreamsRequest, r.StreamsReturns), + }) } res = append(res, cs) }),