full copy of a slice or map to a new var?
because as you know slices and maps are pointers to the underlying array and when we assign them to a new var we actually don't have an independent copy.
Check the example for me to try to understand what I said. https://play.golang.org/p/-UMXyUn3nrY
Use built=in copy for slices, maps you can write your own copy function.
Обсуждают сегодня