MCPcopy Index your code
hub / github.com/cloudfoundry/cli / Contains

Function Contains

util/generic/map.go:121–135  ·  view source on GitHub ↗
(collection, item interface{})

Source from the content-addressed store, hash-verified

119}
120
121func Contains(collection, item interface{}) bool {
122 switch collection := collection.(type) {
123 case Map:
124 return collection.Has(item)
125 case []interface{}:
126 for _, val := range collection {
127 if val == item {
128 return true
129 }
130 }
131 return false
132 }
133
134 panic("unexpected type passed to Contains")
135}
136
137func Each(collection Map, cb Iterator) {
138 for _, key := range collection.Keys() {

Callers 1

ExceptMethod · 0.85

Calls 1

HasMethod · 0.65

Tested by

no test coverage detected