Skip to content

Commit

Permalink
update test and example code
Browse files Browse the repository at this point in the history
  • Loading branch information
Sianao committed Jul 2, 2024
1 parent c154e18 commit 6f8b26d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions slice_example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ func ExampleForEach() {
// 3
// 4
}
func ExampleForEachCondition() {
func ExampleForForEachWhile() {
list := []int64{1, 2, -math.MaxInt, 4}

ForEachCondition(list, func(x int64, _ int) bool {
ForEachWhile(list, func(x int64, _ int) bool {
if x < 0 {
return false
}
Expand Down
4 changes: 2 additions & 2 deletions slice_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func TestForEach(t *testing.T) {
is.IsIncreasing(callParams2)
}

func TestForEachCondition(t *testing.T) {
func TestForEachWhile(t *testing.T) {
t.Parallel()
is := assert.New(t)

Expand All @@ -166,7 +166,7 @@ func TestForEachCondition(t *testing.T) {
var callParams1 []string
var callParams2 []int

ForEachCondition([]string{"a", "b", "c"}, func(item string, i int) bool {
ForEachWhile([]string{"a", "b", "c"}, func(item string, i int) bool {
if item == "c" {
return false
}
Expand Down

0 comments on commit 6f8b26d

Please sign in to comment.