A very common programming problem that arises in most languages is a simple function that returns true
if an input item is present in an array (or dictionary or slice or a variety of other terms) of items and false
if it is not.
Basically, let’s say we had a grouping of items like this:
[cat, dog, bird, turtle, fish, panda]
In my program, I simply want to check if the string gopher
exists. In this case, the function I use will return false
.
The thing about Go is that this isn’t a standard, out-of-the-box function, so we’ll have to write it ourselves.
#coding #software-development #programming #software #golang