From 0b80074bb78c5d0b68a7f33515a17574e2f29eb2 Mon Sep 17 00:00:00 2001 From: dudaodong Date: Mon, 20 Mar 2023 10:35:37 +0800 Subject: [PATCH] refactor: remove unused code --- slice/slice.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/slice/slice.go b/slice/slice.go index 2ef260d..e4270e0 100644 --- a/slice/slice.go +++ b/slice/slice.go @@ -424,10 +424,9 @@ func ForEach[T any](slice []T, iteratee func(index int, item T)) { // ForEachWithBreak iterates over elements of slice and invokes function for each element, // when iteratee return false, will break the for each loop. func ForEachWithBreak[T any](slice []T, iteratee func(index int, item T) bool) { -loop: for i, v := range slice { if !iteratee(i, v) { - break loop + break } } }