slice add golang code example Example 1: go add to slice var s []int s = append(s, 0) Example 2: create slice golang b := [2]string{"Penn", "Teller"}