Remove duplicate elements: Difference between revisions

m
→‎{{header|Go}}: reference associative arrays task
m (→‎{{header|Go}}: reference associative arrays task)
Line 540:
fmt.Println(uniq([]int {1,2,3,2,3,4})) // prints: [3 1 4 2]
}</lang>
replace "int" with another type (must be boolean, numeric, string, pointer, function, interface, map, or channel type) to use for a list of another type. (See [[Associative_arrays/Creation#Go]] for acceptable types.)
 
It takes only small changes to the above code to preserver order. Just store the sequence in the map:
1,707

edits