-
Notifications
You must be signed in to change notification settings - Fork 0
/
contains.go
131 lines (118 loc) · 2.47 KB
/
contains.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
package slices
// ContainsString returns true if an string is present in a iteratee.
func ContainsString(s []string, v string) bool {
for _, vv := range s {
if vv == v {
return true
}
}
return false
}
// ContainsInt returns true if an int is present in a iteratee.
func ContainsInt(s []int, v int) bool {
for _, vv := range s {
if vv == v {
return true
}
}
return false
}
// ContainsInt8 returns true if an int8 is present in a iteratee.
func ContainsInt8(s []int8, v int8) bool {
for _, vv := range s {
if vv == v {
return true
}
}
return false
}
// ContainsInt16 returns true if an int16 is present in a iteratee.
func ContainsInt16(s []int16, v int16) bool {
for _, vv := range s {
if vv == v {
return true
}
}
return false
}
// ContainsInt32 returns true if an int32 is present in a iteratee.
func ContainsInt32(s []int32, v int32) bool {
for _, vv := range s {
if vv == v {
return true
}
}
return false
}
// ContainsInt64 returns true if an int64 is present in a iteratee.
func ContainsInt64(s []int64, v int64) bool {
for _, vv := range s {
if vv == v {
return true
}
}
return false
}
// ContainsUint returns true if an uint is present in a iteratee.
func ContainsUint(s []uint, v uint) bool {
for _, vv := range s {
if vv == v {
return true
}
}
return false
}
// ContainsUint8 returns true if an uint8 is present in a iteratee.
func ContainsUint8(s []uint8, v uint8) bool {
for _, vv := range s {
if vv == v {
return true
}
}
return false
}
// ContainsUint16 returns true if an uint16 is present in a iteratee.
func ContainsUint16(s []uint16, v uint16) bool {
for _, vv := range s {
if vv == v {
return true
}
}
return false
}
// ContainsUint32 returns true if an uint32 is present in a iteratee.
func ContainsUint32(s []uint32, v uint32) bool {
for _, vv := range s {
if vv == v {
return true
}
}
return false
}
// ContainsUint64 returns true if an uint64 is present in a iteratee.
func ContainsUint64(s []uint64, v uint64) bool {
for _, vv := range s {
if vv == v {
return true
}
}
return false
}
// ContainsFloat32 returns true if an float32 is present in a iteratee.
func ContainsFloat32(s []float32, v float32) bool {
for _, vv := range s {
if vv == v {
return true
}
}
return false
}
// ContainsFloat64 returns true if an float64 is present in a iteratee.
func ContainsFloat64(s []float64, v float64) bool {
for _, vv := range s {
if vv == v {
return true
}
}
return false
}