Skip to content

Commit

Permalink
fix: minor
Browse files Browse the repository at this point in the history
  • Loading branch information
Ertugrul Kutluer committed Apr 13, 2022
1 parent 5863b4f commit 6fc6bec
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions docs/collection.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
## Every

Checks if the predicate returns true for all of the collection's elements. When the predicate returns false, the iteration comes to an end.

> ***array, slice, map & struct are supported***
```go
gotil.Every(val, f)
```

### examples

>💻 [Try on Playground](https://go.dev/play/p/WifLSEZaMSS)
```go
m1 := []int{123, 6787}

gotil.Each(m1, func(v interface{}, k interface{}) {
fmt.Println(k, v)
})
```

```go
//output:
0 123
1 6787
```

## Each

Iterates an array of values by running each element in the given array thru iteratee.
Expand Down

0 comments on commit 6fc6bec

Please sign in to comment.