Passed
Push — master ( 6fc6be...61ccf3 )
by ertugrul
02:06 queued 01:08
created

internal.Some   A

Complexity

Conditions 4

Size

Total Lines 10
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 4
eloc 9
dl 0
loc 10
rs 9.95
c 0
b 0
f 0
nop 2
1
package internal
2
3
import (
4
	"github.com/gotilty/gotil/internal/errs"
5
)
6
7
func Some(val, f interface{}) (bool, error) {
8
	state := false
9
	if err := Each(val, func(k, v interface{}) {
10
		if check, _ := Includes(v, f); !check {
11
			state = true
12
		}
13
	}); err == nil {
14
		return state, err
15
	} else {
16
		return false, errs.NewUnsupportedTypeError(err.Error())
17
	}
18
}
19