Includes
Returns true
if the given element can be found in the collection, false
otherwise.
- Use
reflect.ValueOf()
to get the array or slice and the value to search for. - Use a
for
loop withValue.Len()
andValue.Index()
to iterate over each element and compare it to the search value. - Return
true
if a matching value is found,false
otherwise.