From a78274a4b120a86f7ac8094e53294f41d3d66bf5 Mon Sep 17 00:00:00 2001 From: nlwkobe30 Date: Sat, 9 Mar 2024 03:26:18 +0800 Subject: [PATCH] fix: should use type int64 for strconv.FormatInt --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index dd848c39..3c8d069d 100644 --- a/README.md +++ b/README.md @@ -325,11 +325,11 @@ matching := lo.FilterMap([]string{"cpu", "gpu", "mouse", "keyboard"}, func(x str 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 { - return []string{ - strconv.FormatInt(x, 10), - strconv.FormatInt(x, 10), - } +lo.FlatMap([]int64{0, 1, 2}, func(x int64, _ int) []string { + return []string{ + strconv.FormatInt(x, 10), + strconv.FormatInt(x, 10), + } }) // []string{"0", "0", "1", "1", "2", "2"} ```