Skip to content

Commit

Permalink
Typo in README.md MapValues should be MapToSlice (#190)
Browse files Browse the repository at this point in the history
* Typo in README.md MapValues should be MapToSlice

* Fix MapToSlice documentation
  • Loading branch information
CorentinClabaut authored Jul 29, 2022
1 parent 6126b64 commit 85e3ab2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -893,14 +893,14 @@ m2 := lo.MapValues[int, int64, string](m1, func(x int64, _ int) string {
// map[int]string{1: "1", 2: "2", 3: "3"}
```

### MapValues
### MapToSlice

Transforms a map into a slice based on specific iteratee.

```go
m := map[int]int64{1: 4, 2: 5, 3: 6}

s := lo.MapToSlice(m, func(k int, v int) string {
s := lo.MapToSlice(m, func(v int64, k int) string {
return fmt.Sprintf("%d_%d", k, v)
})
// []string{"1_4", "2_5", "3_6"}
Expand Down

0 comments on commit 85e3ab2

Please sign in to comment.