-
-
Save kn9ts/3b9833758283993264b0 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 { | |
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
nil check on list can make this function safe - see