Skip to content

Instantly share code, notes, and snippets.

@henryhamon
Created June 13, 2017 11:47
Show Gist options
  • Save henryhamon/20db3dc136fc5d1a1f0c6559ef35ab8c to your computer and use it in GitHub Desktop.
Save henryhamon/20db3dc136fc5d1a1f0c6559ef35ab8c to your computer and use it in GitHub Desktop.
string in slice
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