There is two mistakes in my example. There is correct one:
package main
import "fmt"
func main() {
array := [...]string{"a", "b", "c", "d"}
slice := array[:]
for i, s := range array {
fmt.Printf("copy_of_array[%d] = %s\n", i, s)
array[3] += s
}
fmt.Println("array =", array)
for i, s := range slice {
fmt.Printf("copy_of_slice[%d] = %s\n", i, s)
slice[3] += s
}
fmt.Println("slice =", slice)
fmt.Println("array =", array)
}
Output is identical as from previous incorrect code.