Ranging over map keys of array type and slicing each array gives the same array for each iteration
问题 When trying to add int array keys of a map to a slice of int slices, ranging and using arr[:] to slice array doesn't work as expected. The resultant slice contains only duplicates of the "first" key in the map(commented out for loop). However, copying the array key to another variable and slicing the new variable works, and the resultant slice contains distinct map key values. I wonder why the copying is necessary. Isn't k , the array key, copied from the map as a new array at each iteration?