cjphaha commented on a change in pull request #1368: URL: https://github.com/apache/dubbo-go/pull/1368#discussion_r695119597
########## File path: registry/nacos/service_discovery.go ########## @@ -240,7 +260,13 @@ func (n *nacosServiceDiscovery) AddListener(listener registry.ServiceInstancesCh }) } - e := n.DispatchEventForInstances(serviceName, instances) + var e error + for _, lis := range n.instanceListenerMap[serviceName].Values() { + var instanceListener registry.ServiceInstancesChangedListener + instanceListener = lis.(registry.ServiceInstancesChangedListener) Review comment: 断言的结果最好检查一下 ########## File path: registry/nacos/service_discovery.go ########## @@ -240,7 +260,13 @@ func (n *nacosServiceDiscovery) AddListener(listener registry.ServiceInstancesCh }) } - e := n.DispatchEventForInstances(serviceName, instances) + var e error + for _, lis := range n.instanceListenerMap[serviceName].Values() { + var instanceListener registry.ServiceInstancesChangedListener + instanceListener = lis.(registry.ServiceInstancesChangedListener) Review comment: 个人认为断言的结果最好检查一下 -- 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-unsubscr...@dubbo.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@dubbo.apache.org For additional commands, e-mail: notifications-h...@dubbo.apache.org