Arrays

Initialize array to 0 values


a := [3]int{}
fmt.Println(a)
[0 0 0]

Set to width of provided literal


b := [...]int{5 + 5, 20, 30}
fmt.Println(b)
[10 20 30]

Compare arrays


// Arrays can be compared in go, but Slices cannot
println(a == b)
false

Set by index, blank are initialized to 0


d := [6]int{1, 2: 4, 5, 5: 100}
fmt.Println(d)
[1 0 4 5 0 100]

Multidimensional array


e := [2][4]int{}
fmt.Println(e)
[[0 0 0 0] [0 0 0 0]]

Go has a simple multidimensional array implementation which incurs performance penalities