slice 1

What does the following program print?
package main

import "fmt"

func main() {
	a := [...]int{0, 1, 2, 3}
	x := a[:1]
	y := a[2:]
	x = append(x, y...)
	x = append(x, y...)
	fmt.Println(a, x)
}

Choices:

Answer: [0 2 3 3] [0 2 3 3 3]

Run it on Go play.

Key points: