From d8598ea01e2fe74c688308b46feade9015bc5c34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Wed, 20 Dec 2023 00:43:37 +0100 Subject: [PATCH 1/6] Fix typos (#384) --- retry.go | 2 +- retry_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/retry.go b/retry.go index c3c264ff..11f456d2 100644 --- a/retry.go +++ b/retry.go @@ -239,7 +239,7 @@ type transactionStep[T any] struct { onRollback func(T) T } -// NewTransaction instanciate a new transaction. +// NewTransaction instantiate a new transaction. func NewTransaction[T any]() *Transaction[T] { return &Transaction[T]{ steps: []transactionStep[T]{}, diff --git a/retry_test.go b/retry_test.go index 91ad651b..1ac00703 100644 --- a/retry_test.go +++ b/retry_test.go @@ -404,7 +404,7 @@ func TestDebounceBy(t *testing.T) { mu.Unlock() } -func TestTransation(t *testing.T) { +func TestTransaction(t *testing.T) { is := assert.New(t) // no error From d1c7f3ae19929161732de0c3de086db48d6f2580 Mon Sep 17 00:00:00 2001 From: Samuel Berthe Date: Wed, 20 Dec 2023 00:47:09 +0100 Subject: [PATCH 2/6] Update slice.go --- slice.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slice.go b/slice.go index 49c991f8..4bfed2de 100644 --- a/slice.go +++ b/slice.go @@ -232,7 +232,7 @@ func Flatten[T any](collection [][]T) []T { } // Interleave round-robin alternating input slices and sequentially appending value at index into result -// Play: https://go.dev/play/p/DDhlwrShbwe +// Play: https://go.dev/play/p/-RJkTLQEDVt func Interleave[T any](collections ...[]T) []T { if len(collections) == 0 { return []T{} From ddac010f67978b370cd3dad9a5dd91434cbddfc4 Mon Sep 17 00:00:00 2001 From: chrom Date: Wed, 20 Dec 2023 08:47:17 +0900 Subject: [PATCH 3/6] doc: fix interleave example (#386) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c0852b50..3e7e59a1 100644 --- a/README.md +++ b/README.md @@ -543,7 +543,7 @@ interleaved := lo.Interleave([]int{1}, []int{2, 5, 8}, []int{3, 6}, []int{4, 7, // []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10} ``` -[[play](https://go.dev/play/p/DDhlwrShbwe)] +[[play](https://go.dev/play/p/-RJkTLQEDVt)] ### Shuffle From 334eafc506667ce1e32158a1082c14ea7ec887e2 Mon Sep 17 00:00:00 2001 From: guangwu Date: Wed, 20 Dec 2023 07:47:58 +0800 Subject: [PATCH 4/6] fix: instantiate typo (#374) From 46aca3d32c0500e6015fa71ea1abbb4ddb31332c Mon Sep 17 00:00:00 2001 From: Ikko Eltociear Ashimine Date: Wed, 20 Dec 2023 08:48:27 +0900 Subject: [PATCH 5/6] Fix typo in README.md (#369) intializations -> initializations --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3e7e59a1..ea3fb26a 100644 --- a/README.md +++ b/README.md @@ -2048,7 +2048,7 @@ result := lo.TernaryF(false, func() string { return "a" }, func() string { retur // "b" ``` -Useful to avoid nil-pointer dereferencing in intializations, or avoid running unnecessary code +Useful to avoid nil-pointer dereferencing in initializations, or avoid running unnecessary code ```go var s *string From 71d834120db5c5aa322ff4898bdd3b2d8964141e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20S=C5=82omka?= Date: Wed, 20 Dec 2023 00:50:08 +0100 Subject: [PATCH 6/6] docs: update description for FindOrElse (#370) * docs: update description for FindOrElse * Update README.md --------- Co-authored-by: Samuel Berthe --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ea3fb26a..dd848c39 100644 --- a/README.md +++ b/README.md @@ -1824,7 +1824,7 @@ str, index, ok := lo.FindLastIndexOf([]string{"foobar"}, func(i string) bool { ### FindOrElse -Search an element in a slice based on a predicate. It returns element and true if element was found. +Search an element in a slice based on a predicate. It returns the element if found or a given fallback value otherwise. ```go str := lo.FindOrElse([]string{"a", "b", "c", "d"}, "x", func(i string) bool {