Alanxtl commented on code in PR #986:
URL: https://github.com/apache/dubbo-go-samples/pull/986#discussion_r2604971306
##########
direct/go-client/cmd/main.go:
##########
@@ -37,19 +37,31 @@ func main() {
client.WithClientURL("tri://127.0.0.1:20000"),
)
if err != nil {
- panic(err)
+ panic(err) // fail fast if client cannot be created
}
greetService, err := greet.NewGreetService(cli)
if err != nil {
- panic(err)
+ panic(err) // fail fast if service proxy cannot be created
}
- req := &greet.GreetRequest{Name: "dubbo-go"}
+ // Direct call: 1 request -> 1 response
+ name := "Golang Client dubbo-go"
+ req := &greet.GreetRequest{Name: name}
resp, err := greetService.Greet(context.Background(), req)
if err != nil {
- logger.Errorf("direct call failed: %v", err)
- return
+ panic(err)
+ }
+ if resp == nil {
+ panic("direct call failed: empty response")
}
+
+ // Go 服务返回 "hello {name}",Java 示例服务返回 "hello from java server, {name}"
Review Comment:
use english
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]