Golang Book

Chapter-by-chapter examples and problems from `An Introduction to Programming in Go` by Caleb Doxsey



How do you access the 4th element of an array or slice?

array[3] and slice[3]

What is the length of a slice created using: make([]int, 3, 9)?

3, with the capacity of 9.

Given the array:*

x := [6]string{"a", "b", "c", "d", "e", "f"}

What would x[2:5] give you?

{“c”, “d”, “e”, “f”}