@@ -853,6 +853,17 @@ func (c1 *ConsumerGroup) EqualWithOpts(c2 *ConsumerGroup,
853853 u1Copy .CreatedAt = nil
854854 u2Copy .CreatedAt = nil
855855 }
856+
857+ if len (u1Copy .Tags ) == 0 {
858+ u1Copy .Tags = nil
859+ }
860+ if len (u2Copy .Tags ) == 0 {
861+ u2Copy .Tags = nil
862+ }
863+
864+ sort .Slice (u1Copy .Tags , func (i , j int ) bool { return * (u1Copy .Tags [i ]) < * (u1Copy .Tags [j ]) })
865+ sort .Slice (u2Copy .Tags , func (i , j int ) bool { return * (u2Copy .Tags [i ]) < * (u2Copy .Tags [j ]) })
866+
856867 return reflect .DeepEqual (u1Copy , u2Copy )
857868}
858869
@@ -905,6 +916,37 @@ func (c1 *ConsumerGroupConsumer) EqualWithOpts(c2 *ConsumerGroupConsumer,
905916 c2Copy .ConsumerGroup .CreatedAt = nil
906917 c1Copy .ConsumerGroup .CreatedAt = nil
907918 }
919+
920+ if len (c1Copy .ConsumerGroup .Tags ) == 0 {
921+ c1Copy .ConsumerGroup .Tags = nil
922+ }
923+
924+ if len (c2Copy .ConsumerGroup .Tags ) == 0 {
925+ c2Copy .ConsumerGroup .Tags = nil
926+ }
927+
928+ sort .Slice (c1Copy .ConsumerGroup .Tags , func (i , j int ) bool {
929+ return * (c1Copy .ConsumerGroup .Tags [i ]) < * (c1Copy .ConsumerGroup .Tags [j ])
930+ })
931+ sort .Slice (c2Copy .ConsumerGroup .Tags , func (i , j int ) bool {
932+ return * (c2Copy .ConsumerGroup .Tags [i ]) < * (c2Copy .ConsumerGroup .Tags [j ])
933+ })
934+
935+ if len (c1Copy .Consumer .Tags ) == 0 {
936+ c1Copy .Consumer .Tags = nil
937+ }
938+
939+ if len (c2Copy .Consumer .Tags ) == 0 {
940+ c2Copy .Consumer .Tags = nil
941+ }
942+
943+ sort .Slice (c1Copy .Consumer .Tags , func (i , j int ) bool {
944+ return * (c1Copy .Consumer .Tags [i ]) < * (c1Copy .Consumer .Tags [j ])
945+ })
946+ sort .Slice (c2Copy .Consumer .Tags , func (i , j int ) bool {
947+ return * (c2Copy .Consumer .Tags [i ]) < * (c2Copy .Consumer .Tags [j ])
948+ })
949+
908950 return reflect .DeepEqual (c1Copy , c2Copy )
909951}
910952
@@ -952,6 +994,17 @@ func (c1 *ConsumerGroupPlugin) EqualWithOpts(c2 *ConsumerGroupPlugin,
952994 c1Copy .ConsumerGroup .CreatedAt = nil
953995 c2Copy .ConsumerGroup .CreatedAt = nil
954996 }
997+
998+ if len (c1Copy .Tags ) == 0 {
999+ c1Copy .Tags = nil
1000+ }
1001+ if len (c2Copy .Tags ) == 0 {
1002+ c2Copy .Tags = nil
1003+ }
1004+
1005+ sort .Slice (c1Copy .Tags , func (i , j int ) bool { return * (c1Copy .Tags [i ]) < * (c1Copy .Tags [j ]) })
1006+ sort .Slice (c2Copy .Tags , func (i , j int ) bool { return * (c2Copy .Tags [i ]) < * (c2Copy .Tags [j ]) })
1007+
9551008 return reflect .DeepEqual (c1Copy , c2Copy )
9561009}
9571010
@@ -1902,6 +1955,16 @@ func (p *Partial) EqualWithOpts(p2 *Partial, ignoreID, ignoreTS bool) bool {
19021955 p1Copy .UpdatedAt = nil
19031956 p2Copy .UpdatedAt = nil
19041957 }
1958+
1959+ if len (p1Copy .Tags ) == 0 {
1960+ p1Copy .Tags = nil
1961+ }
1962+ if len (p2Copy .Tags ) == 0 {
1963+ p2Copy .Tags = nil
1964+ }
1965+
1966+ sort .Slice (p1Copy .Tags , func (i , j int ) bool { return * (p1Copy .Tags [i ]) < * (p1Copy .Tags [j ]) })
1967+ sort .Slice (p2Copy .Tags , func (i , j int ) bool { return * (p2Copy .Tags [i ]) < * (p2Copy .Tags [j ]) })
19051968 return reflect .DeepEqual (p1Copy , p2Copy )
19061969}
19071970
0 commit comments