Append one slice to another with ...:
a := []int{1, 2, 3}
b := []int{4, 5, 6}
c := append(a, b...)
The ... expands b into individual elements. Without it, you'd be appending a slice as a single element, which doesn't work for []int.
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
Combining slices
Append one slice to another with ...:
a := []int{1, 2, 3}
b := []int{4, 5, 6}
c := append(a, b...)
The ... expands b into individual elements. Without it, you'd be appending a slice as a single element, which doesn't work for []int.