Passed
Push — master ( 8b69c4...6c4303 )
by ertugrul
01:31 queued 36s
created

internal/every.go   A

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
cc 4
eloc 12
dl 0
loc 16
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A internal.Every 0 10 4
1
package internal
2
3
import (
4
	"github.com/gotilty/gotil/internal/errs"
5
)
6
7
func Every(val, f interface{}) (bool, error) {
8
	state := true
9
	if err := Each(val, func(k, v interface{}) {
10
		if check, _ := Includes(v, f); !check {
11
			state = false
12
		}
13
	}); err == nil {
14
		return state, err
15
	} else {
16
		return false, errs.NewUnsupportedTypeError(err.Error())
17
	}
18
}
19