Created
July 15, 2015 18:21
-
-
Save anonymous/028e3638555a090ccd18 to your computer and use it in GitHub Desktop.
inArray function equive in Go lang
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