Skip to content

Commit 3f92bd4

Browse files
committed
fix: fix comparing any type values error.
1 parent 5a66f27 commit 3f92bd4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

util.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ func isEqual(x, y any) bool {
132132
case reflect.Slice:
133133
return isSliceEqual(v1, v2)
134134
default:
135-
return x == y
135+
return v1.Interface() == v2.Interface()
136136
}
137137
}
138138

@@ -193,7 +193,7 @@ func isMapHasValue(m, v any) bool {
193193

194194
for iter.Next() {
195195
mvv := iter.Value()
196-
if isEqual(mvv, vv) {
196+
if isEqual(mvv, vv.Convert(mvv.Type())) {
197197
return true
198198
}
199199
}

0 commit comments

Comments
 (0)