Today’s quiz day. Tomorrow I’ll provide the answer as we continue with the section of the spec that explains today’s code.
Consider the following program. What is its output?
package main
import "fmt"
func main() {
a := []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
s := a[2:5]
s2 := s[5:7]
fmt.Println(s2)
}
[6 7]
[8 9]
- A runtime panic
- A compilation error