fix: fix UniqueBy bug

This commit is contained in:
dudaodong committed 2024-08-08 10:40:23 +08:00
1 parent 356351896d
commit 3e7f94b03e
7 files changed
+27 -18

No files matched your search

+2 -1
View File
@@ -733,7 +733,8 @@ func TestUniqueBy(t *testing.T) {
actual := UniqueBy([]int{1, 2, 3, 4, 5, 6}, func(val int) int {
return val % 4
})
assert.Equal([]int{1, 2, 3, 0}, actual)
assert.Equal([]int{1, 2, 3, 4}, actual)
}
func TestUniqueByField(t *testing.T) {