I have a message byte Buffer and I would like to append a byte at the end of the Buffer
I tried to append like this:
append(message.Buf, 0xff)
first argument to append must be slice; have *bytes.Buffer
append(0xff,message.Buf)
first argument to append must be slice; have untyped number
How can I make the 0xff as a slice to append?
appendis for appending values to a slice and has absolutely nothing to do with bytes.Buffer which is not a slice. Just Write to your bytes.Buffer. And please read the docs ,especially golang.org/pkg/bytes/#Buffer.WriteByte