Skip to content

Instantly share code, notes, and snippets.

@ambalabanov
Created March 22, 2020 09:06
Show Gist options
  • Save ambalabanov/916f74d6d59a70f511b2c7bf79e3b912 to your computer and use it in GitHub Desktop.
Save ambalabanov/916f74d6d59a70f511b2c7bf79e3b912 to your computer and use it in GitHub Desktop.
func RemoveDuplicates(input *[]string) {
found := make(map[string]bool)
var unique []string
for _, val := range *input {
if found[val] == false {
found[val] = true
unique = append(unique, val)
}
}
*input = unique
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment