From 936dd6700819d661f20fe4d7005dffb45ce5a8a3 Mon Sep 17 00:00:00 2001 From: kevin Date: Mon, 12 Oct 2020 11:39:50 +0800 Subject: [PATCH] simplify code generation --- tools/goctl/rpc/gen/genmain.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/goctl/rpc/gen/genmain.go b/tools/goctl/rpc/gen/genmain.go index c9b6ccd5..be5a26a6 100644 --- a/tools/goctl/rpc/gen/genmain.go +++ b/tools/goctl/rpc/gen/genmain.go @@ -35,10 +35,9 @@ func main() { ctx := svc.NewServiceContext(c) {{.srv}} - s, err := zrpc.NewServer(c.RpcServerConf, func(grpcServer *grpc.Server) { + s := zrpc.MustNewServer(c.RpcServerConf, func(grpcServer *grpc.Server) { {{.registers}} }) - logx.Must(err) defer s.Stop() fmt.Printf("Starting rpc server at %s...\n", c.ListenOn)