Make a unique slice from an existing slice

by a small simple function.

Photo by Karl Lee on Unsplash

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.

--

--

--

A passionate automation engineer who strongly believes in “A man can do anything he wants if he puts in the work”.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

7 Tips for that can help Learn Programming Faster

Manual Or Draft Status In Klaviyo Emails?

Arth Task: 12.2

Container Networking Is Simple!

[Algorithm] Big O Notation with C++ vectors

5 reasons to learn multithreading

Becoming A Software Engineer for Extraordinary Career Growth

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Donald Le

Donald Le

A passionate automation engineer who strongly believes in “A man can do anything he wants if he puts in the work”.

More from Medium

A Short Intro to Testing in Software Development for beginners

Git and GitHub : master your important tool as a developer .

Git: The Basics Of Version Control Management

Clean Coding and Test Driven Development : A beginner’s introduction to software development — I

An image to vaguely represent coding.