From e2be213f5fb72e9033e8fc723e8b2b8fa78b4c5e Mon Sep 17 00:00:00 2001 From: Julian LaNeve Date: Mon, 20 Mar 2023 12:35:36 -0400 Subject: [PATCH] Update FlatMap docs to talk about nil case (#314) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bfde50fe..09419ff7 100644 --- a/README.md +++ b/README.md @@ -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 {