Use append() to add elements to a slice:
s := []int{1, 2, 3}
s = append(s, 4) // add one element
s = append(s, 5, 6, 7) // add multiple elements
The append function returns a new slice. Always assign the result back. If the underlying array is too small, append allocates a larger one and copies the data. This happens automatically.