I recently tried appending two byte array slices in Go and came across some odd errors. My code is:
one:=make([]byte, 2)
two:=make([]byte, 2)
one[0]=0x00
one
append() takes a slice of type []T, and then a variable number of values of the type of the slice member T. In other words, if you pass a []uint8 as the slice to append() then it wants every subsequent argument to be a uint8.
The solution to this is to use the slice... syntax for passing a slice in place of a varargs argument. Your code should look like
log.Printf("%X", append(one[:], two[:]...))
and
five:=append(three, four...)