You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2022/05/08 10:53:13 UTC

[GitHub] [dubbo-go] AlexStocks commented on a diff in pull request #1866: fix: complete grpc based protocol panic recover handle.

AlexStocks commented on code in PR #1866:
URL: https://github.com/apache/dubbo-go/pull/1866#discussion_r867472025


##########
common/proxy/proxy_factory/default.go:
##########
@@ -84,8 +85,8 @@ type ProxyInvoker struct {
 }
 
 // Invoke is used to call service method by invocation
-func (pi *ProxyInvoker) Invoke(ctx context.Context, invocation protocol.Invocation) protocol.Result {
-	result := &protocol.RPCResult{}
+func (pi *ProxyInvoker) Invoke(ctx context.Context, invocation protocol.Invocation) (result protocol.Result) {
+	result = &protocol.RPCResult{}

Review Comment:
    不要在返回值处定义变量,容易造成 shadow var。原来的实现挺好的。



-- 
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-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org