This gist explains difference between arrays and slices in Golang
Usually what we understand with an array is that it stores objects with same types in locations called indexes (starting at 0).
so, [1,2,3,4,5] contains numbers (integers) from 1 to 5. each of them at indexes 0,1,2,3,4 respectively.
In golang there are two types of arrays like other languages.
arrays of fixed and dynamic sizes.
Fixed sized arrays are called, well.... Arrays
Dynamic sized arrays are called slices.
Let's see an example how to define an array and a slice
a := [5]int{1,2,3,4,5}
// or
// var a := make([]int, 5)
// then fill the values for each index with loop
fmt.Printf("a: %+v\n", a)
b := []int
// slices can be appended
b = append(b, 1)
b = append(b, 2)
b = append(b, 3)
fmt.Println(b)