Skip to content

Commit

Permalink
#6 #3 updated the equals method to explicitly compare the fields of t…
Browse files Browse the repository at this point in the history
…he TopicIdPartition struct
  • Loading branch information
Krishnakant C authored and Krishnakant C committed Sep 6, 2024
1 parent 004b184 commit c7df71a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion internal/client/common/topicid_partition.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,15 @@ func (tip *TopicIdPartition) Equals(other *TopicIdPartition) bool {
if other == nil {
return false
}
return tip.topicId == other.topicId && tip.topicPartition == other.topicPartition
// Compare Uuid
if tip.topicId != other.topicId {
return false
}
// Compare TopicPartition
if tip.topicPartition.Topic() != other.topicPartition.Topic() || tip.topicPartition.Partition() != other.topicPartition.Partition() {
return false
}
return true
}

// String returns a string representation of the TopicIdPartition.
Expand Down

0 comments on commit c7df71a

Please sign in to comment.