diff --git a/README.md b/README.md index 79b38efe..71414c74 100644 --- a/README.md +++ b/README.md @@ -348,7 +348,7 @@ lop.Map([]int64{1, 2, 3, 4}, func(x int64, _ int) string { ### UniqMap -UniqMap manipulates a slice and transforms it to a slice of another type with unique values. +Manipulates a slice and transforms it to a slice of another type with unique values. ```go type User struct { @@ -357,7 +357,7 @@ type User struct { } users := []User{{Name: "Alex", Age: 10}, {Name: "Alex", Age: 12}, {Name: "Bob", Age: 11}, {Name: "Alice", Age: 20}} -names := UniqMap(users, func(u User, index int) string { +names := lo.UniqMap(users, func(u User, index int) string { return u.Name }) // []string{"Alex", "Bob", "Alice"}