Created
March 22, 2020 09:06
-
-
Save ambalabanov/916f74d6d59a70f511b2c7bf79e3b912 to your computer and use it in GitHub Desktop.
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 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