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

internal/includes.go   A

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 7
dl 0
loc 14
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A internal.Includes 0 4 1
1
package internal
2
3
import (
4
	"strings"
5
)
6
7
// It checks whether the given value exists in the given parameter.
8
// 		data := []float64{5, 10.5, 10, 20, 10.75, 100, 4.23, 5.15, 5.99, 100.0001}
9
// 		result, _ := Includes(data, "gotil")
10
// 		// Output: false
11
func Includes(a interface{}, val interface{}) (bool, error) {
12
	a_str, _ := ToString(a)
13
	val_str, _ := ToString(val)
14
	return (strings.Contains(a_str, val_str)), nil
15
}
16