InvalidCopy occurs when the arguments are not of slice type or do not have compatible type. See https://golang.org/ref/spec#Appending_and_copying_slices for more information on the type requirements for the copy built-in. Example: func f() { var x []int y := []int64{1,2,3} copy(x, y) }