I want to create a function that can retrieve data that has no duplicates from a slice
an example of a slice that will be processed:
number1 := []int{3,4,5,4,3}
number2 := []int{3,4,5,6,4,3}
expected result :
res1 = []int{5}
res2 = []int{5,6}
i have do something like this
func unique(arg []int) []int {
    var inResult = make(map[int]bool)
    var result []int
    for _, value := range arg {
        if _, ok := inResult[value]; !ok {
            inResult[value] = true
            result = append(result, value)
        } else {
            inResult[value] = false
        }
    }
    fmt.Println(inResult)
    return result
}
func main() {   arg := []int{6, 6, 7, 1, 2, 3, 4, 5, 3, 2, 1}
    res := unique(arg)
    fmt.Println(res)
}
how to get the key from map where the value is true?
map[1:false 2:false 3:false 4:true 5:true 6:false 7:true]
[6 7 1 2 3 4 5]
 
    