From f8367856e8870b4e351be2123d3d07871a867fe7 Mon Sep 17 00:00:00 2001 From: Kevin Wan Date: Mon, 8 Nov 2021 23:12:13 +0800 Subject: [PATCH] chore: refine code (#1215) --- tools/goctl/rpc/generator/genmain.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tools/goctl/rpc/generator/genmain.go b/tools/goctl/rpc/generator/genmain.go index f7aff9dd..19ee9570 100644 --- a/tools/goctl/rpc/generator/genmain.go +++ b/tools/goctl/rpc/generator/genmain.go @@ -40,12 +40,9 @@ func main() { s := zrpc.MustNewServer(c.RpcServerConf, func(grpcServer *grpc.Server) { {{.pkg}}.Register{{.service}}Server(grpcServer, srv) - switch c.Mode { - case service.DevMode,service.TestMode: + if c.Mode == service.DevMode || c.Mode == service.TestMode { reflection.Register(grpcServer) - default: } - }) defer s.Stop()