Go
Make a unique slice from an existing slice
For example a slice
var simpleSlice []string
simpleSlice = append(simpleSlice, "test", "test", "donald", "ad", "thuy")
We need to convert a new slice like [“test”, “donald”, “ad”, “thuy”] by defining a new function for convert.
Running the program will show
[test donald ad thuy]
Thanks for reading my post.
Happy coding~~