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


##########
protocol/grpc/server.go:
##########
@@ -243,6 +198,14 @@ func registerService(providerServices 
map[string]*global.ServiceConfig, server *
                if invoker == nil {
                        panic(fmt.Sprintf("no invoker found for servicekey: 
%v", serviceKey))
                }
+               service, ok := 
invoker.GetURL().GetAttribute(constant.RpcServiceKey)
+               if !ok {
+                       panic(fmt.Sprintf("no rpc service found in url 
attribute %s for servicekey: %v", constant.RpcServiceKey, serviceKey))
+               }
+               ds, ok := service.(DubboGrpcService)
+               if !ok {
+                       panic("illegal service type registered")
+               }
 
                ds.SetProxyImpl(invoker)
                server.RegisterService(ds.ServiceDesc(), service)

Review Comment:
   确认已修复。`server.RegisterService(ds.ServiceDesc(), ds)` 类型一致,消除了 `any` 类型不匹配的风险。



-- 
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]

Reply via email to