Copilot commented on code in PR #175:
URL: https://github.com/apache/iotdb-client-go/pull/175#discussion_r3820607232


##########
common/common.go:
##########
@@ -6709,28 +6823,37 @@ func (p *TPipeHeartbeatResp) Equals(other 
*TPipeHeartbeatResp) bool {
        }
        if len(p.PipeMetaList) != len(other.PipeMetaList) { return false }
        for i, _tgt := range p.PipeMetaList {
-               _src29 := other.PipeMetaList[i]
-               if bytes.Compare(_tgt, _src29) != 0 { return false }
+               _src32 := other.PipeMetaList[i]
+               if bytes.Compare(_tgt, _src32) != 0 { return false }
        }
        if len(p.PipeCompletedList) != len(other.PipeCompletedList) { return 
false }
        for i, _tgt := range p.PipeCompletedList {
-               _src30 := other.PipeCompletedList[i]
-               if _tgt != _src30 { return false }
+               _src33 := other.PipeCompletedList[i]
+               if _tgt != _src33 { return false }
        }
        if len(p.PipeRemainingEventCountList) != 
len(other.PipeRemainingEventCountList) { return false }
        for i, _tgt := range p.PipeRemainingEventCountList {
-               _src31 := other.PipeRemainingEventCountList[i]
-               if _tgt != _src31 { return false }
+               _src34 := other.PipeRemainingEventCountList[i]
+               if _tgt != _src34 { return false }
        }
        if len(p.PipeRemainingTimeList) != len(other.PipeRemainingTimeList) { 
return false }
        for i, _tgt := range p.PipeRemainingTimeList {
-               _src32 := other.PipeRemainingTimeList[i]
-               if _tgt != _src32 { return false }
+               _src35 := other.PipeRemainingTimeList[i]
+               if _tgt != _src35 { return false }
        }
        if len(p.PipeDegradedStatusList) != len(other.PipeDegradedStatusList) { 
return false }
        for i, _tgt := range p.PipeDegradedStatusList {
-               _src33 := other.PipeDegradedStatusList[i]
-               if _tgt != _src33 { return false }
+               _src36 := other.PipeDegradedStatusList[i]
+               if _tgt != _src36 { return false }
+       }
+       if len(p.PipeRecentFailureList) != len(other.PipeRecentFailureList) { 
return false }
+       for i, _tgt := range p.PipeRecentFailureList {
+               _src37 := other.PipeRecentFailureList[i]
+               if len(_tgt) != len(_src37) { return false }
+               for k, _tgt := range _tgt {
+                       _src38 := _src37[k]
+                       if _tgt != _src38 { return false }

Review Comment:
   This equality check does not verify that the key exists in the other map. 
Because a missing Go map key reads as the value type's zero value, maps such as 
`{"a": 0}` and `{"b": 0}` have equal lengths and are incorrectly reported as 
equal. Check the lookup boolean as well (and make the corresponding 
generator/template fix so regeneration preserves it).



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

Reply via email to