Copilot commented on code in PR #905: URL: https://github.com/apache/dubbo-go-samples/pull/905#discussion_r2311752357
########## rpc/multi-protocols/go-server/cmd/main.go: ########## @@ -70,38 +71,17 @@ func main() { panic(err) } //Triple - srvTriple, err := ins.NewServer() + srv, err := ins.NewServer() if err != nil { panic(err) } - if err = greet2.RegisterGreetServiceHandler(srvTriple, &GreetMultiRPCServer{}); err != nil { + if err = greet2.RegisterGreetServiceHandler(srv, &GreetMultiRPCServer{}); err != nil { panic(err) } - if err = srvTriple.Serve(); err != nil { - logger.Error(err) - } - - //Dubbo - srvDubbo, err := ins.NewServer() - if err != nil { - panic(err) - } - if err = srvDubbo.Register(&GreetProvider{}, nil, server.WithInterface("GreetProvider")); err != nil { - panic(err) - } - if err = srvDubbo.Serve(); err != nil { - logger.Error(err) - } - - //JsonRpc - srvJsonRpc, err := ins.NewServer() - if err != nil { - panic(err) - } - if err = srvJsonRpc.Register(&GreetProvider{}, nil, server.WithInterface("GreetProvider")); err != nil { + if err = srv.Register(&GreetProvider{}, &common.ServiceInfo{}, server.WithInterface("GreetProvider")); err != nil { Review Comment: Passing an empty ServiceInfo struct may not provide the necessary metadata for service registration. Consider initializing ServiceInfo with appropriate values or verify that an empty struct is the intended behavior for this registration. ```suggestion if err = srv.Register(&GreetProvider{}, &common.ServiceInfo{ Name: "GreetProvider", InterfaceName: "GreetProvider", }, server.WithInterface("GreetProvider")); err != nil { ``` ########## helloworld/go-client/cmd/main.go: ########## @@ -33,6 +33,7 @@ import ( ) func main() { + logger.Info("start helloword/go-client") Review Comment: There's a typo in 'helloword' - it should be 'helloworld' to match the project name. ```suggestion logger.Info("start helloworld/go-client") ``` ########## helloworld/go-server/cmd/main.go: ########## @@ -42,6 +42,7 @@ func (srv *GreetTripleServer) Greet(ctx context.Context, req *greet.GreetRequest } func main() { + logger.Info("start helloword/go-server") Review Comment: There's a typo in 'helloword' - it should be 'helloworld' to match the project name. ```suggestion logger.Info("start helloworld/go-server") ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@dubbo.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@dubbo.apache.org For additional commands, e-mail: notifications-h...@dubbo.apache.org