Passed
Push — main ( a82edc...08e96c )
by Igor
58s queued 11s
created

is.StringInList   A

Complexity

Conditions 3

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 5
nop 2
dl 0
loc 8
rs 10
c 0
b 0
f 0
1
package is
2
3
// StringInList returns true if one of the elements of the list is equal to the string.
4
func StringInList(s string, list []string) bool {
5
	for _, ls := range list {
6
		if ls == s {
7
			return true
8
		}
9
	}
10
11
	return false
12
}
13