redlsz commented on code in PR #680:
URL: https://github.com/apache/rocketmq-clients/pull/680#discussion_r1475787902


##########
golang/client.go:
##########
@@ -513,18 +513,39 @@ func (cli *defaultClient) startUp() error {
                                cli.log.Info("newRoute is nil, but oldRoute is 
not. do not update")
                                return true
                        }
-                       if !reflect.DeepEqual(newRoute, oldRoute) {
+                       routeEqual := func(old, new []*v2.MessageQueue) bool {

Review Comment:
   > In C++ implementation, I used 
[MessageDifferencer](https://protobuf.dev/reference/cpp/api-docs/google.protobuf.util.message_differencer/)
 to achieve this; Golang has 
[protocmp](https://pkg.go.dev/google.golang.org/protobuf/testing/protocmp). Can 
we use protocmp to compare generically instead of manual work, which is 
error-prone over time?
   
   The [go-cmp](https://pkg.go.dev/github.com/google/go-cmp/cmp) and 
[protocmp](https://pkg.go.dev/google.golang.org/protobuf/testing/protocmp) seem 
being for testing. And manual comparison here is actually based on 
[proto.Equal](https://github.com/protocolbuffers/protobuf-go/blob/v1.32.0/proto/equal.go#L41)



-- 
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: commits-unsubscr...@rocketmq.apache.org

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

Reply via email to