Created
June 13, 2017 11:47
-
-
Save henryhamon/20db3dc136fc5d1a1f0c6559ef35ab8c to your computer and use it in GitHub Desktop.
string in slice
This file contains hidden or 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
func stringInSlice(a string, list []string) bool { | |
for _, b := range list { | |
if b == a { | |
return true | |
} | |
} | |
return false | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment