Total Lines | 14 |
Duplicated Lines | 0 % |
Changes | 0 |
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 |