nanjiek commented on code in PR #3231:
URL: https://github.com/apache/dubbo-go/pull/3231#discussion_r2899840318
##########
protocol/grpc/client.go:
##########
@@ -142,25 +118,25 @@ func NewClient(url *common.URL) (*Client, error) {
}
key := url.GetParam(constant.InterfaceKey, "")
- //TODO: Temporary compatibility with old APIs, can be removed later
- consumerService := config.GetConsumerServiceByInterfaceName(key)
- if consumerService == nil {
- if rpcService, ok := url.GetAttribute(constant.RpcServiceKey);
ok {
- consumerService = rpcService
- }
+ var consumerService any
+ if rpcService, ok := url.GetAttribute(constant.RpcServiceKey); ok {
+ consumerService = rpcService
}
invoker := getInvoker(consumerService, conn)
+ invokerValue := reflect.Value{}
+ if invoker != nil {
+ invokerValue = reflect.ValueOf(invoker)
+ } else {
+ logger.Warnf("grpc client invoker is nil, interface=%s", key)
Review Comment:
```suggestion
err := fmt.Errorf("grpc client invoker is nil, interface=%s",
key)
logger.Errorf("failed to get grpc client invoker: %v", err)
return nil, err
```
--
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]