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()