1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-12 08:42:29 +08:00

fix: fix UniqueBy bug

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

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) {