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

map.go   A

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A gotil.Map 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
// 		// Example:
11
// 		func square(a interface{}, i int()) interface{} {
12
// 			b, _ := ToInt64(a)
13
// 			return (b * b)
14
// 		}
15
func Map(a interface{}, f func(val interface{}, i int) interface{}) (interface{}, error) {
16
	return internal.Map(a, f)
17
}
18