Skip to content

Commit

Permalink
Update FlatMap docs to talk about nil case (#314)
Browse files Browse the repository at this point in the history
  • Loading branch information
jlaneve committed Mar 20, 2023
1 parent 56ef8fe commit e2be213
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ matching := lo.FilterMap([]string{"cpu", "gpu", "mouse", "keyboard"}, func(x str

### FlatMap

Manipulates a slice and transforms and flattens it to a slice of another type.
Manipulates a slice and transforms and flattens it to a slice of another type. The transform function can either return a slice or a `nil`, and in the `nil` case no value is added to the final slice.

```go
lo.FlatMap([]int{0, 1, 2}, func(x int, _ int) []string {
Expand Down

0 comments on commit e2be213

Please sign in to comment.