1kasa commented on code in PR #2858:
URL: https://github.com/apache/dubbo-go/pull/2858#discussion_r2083217269


##########
client/client.go:
##########
@@ -96,12 +112,29 @@ func (conn *Connection) CallBidiStream(ctx 
context.Context, methodName string, o
        return res.Result(), res.Error()
 }
 
+func (cli *Client) NewService(service any, opts ...ReferenceOption) 
(*Connection, error) {
+       interafceName := common.GetReference(service)

Review Comment:
   typo error,I think you meanning interfaceName?



##########
client/client.go:
##########
@@ -96,12 +112,29 @@ func (conn *Connection) CallBidiStream(ctx 
context.Context, methodName string, o
        return res.Result(), res.Error()
 }
 
+func (cli *Client) NewService(service any, opts ...ReferenceOption) 
(*Connection, error) {
+       interafceName := common.GetReference(service)

Review Comment:
   It's better to add defensive programming here.
   ```
   if service == nil {
        return nil, errors.New("service must not be nil")
   }
   ```
   To avoid panic caused by sType := reflect.TypeOf(service), and 
toTroubleshoot errors
   



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