Passed
Pull Request — master (#66)
by Hayrullah
56s
created

each.go   A

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
dl 0
loc 15
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A gotil.Each 0 2 1
1
package gotil
2
3
import (
4
	"github.com/gotilty/gotil/internal"
5
)
6
7
// Creates an array of values by running each element in the given array thru iteratee.
8
// The value to be iterated should be given as the first parameter.
9
// The second parameter will be a function that will take the parameter and return value type interface{}.
10
// 		_ = Each([]int64{10, 20, 30}, func(val interface{}, i int) {
11
// 			fmt.Printf("%d apples", val)
12
// 		})
13
// 		// Output: 10 apples20 apples30 apples
14
func Each(a interface{}, f func(val interface{}, i int)) error {
15
	return internal.Each(a, f)
16
}
17