-
-
Save prasad83/dc88f7c1a8534af33d0ae020967d47de to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Function to check if the the string given is in the array | |
inArray := func(str string, list []string) bool { | |
// early exit if list is nil | |
if list == nil { | |
return false | |
} | |
for _, v := range list { | |
if v == str { | |
return true | |
} | |
} | |
return false | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment