I created the following test code. To isolate the compile error. Why do i get the error message :
cannot use messageBody (type []byte) as type byte in append. Greeting from Amsterdam, Perry package main import ( "encoding/hex" "fmt" ) func encodeMessage(messageBody []byte) ([]byte) { tmp,_ := hex.DecodeString(fmt.Sprintf("AB000300000000007F0100")) DataResponse := append(tmp, messageBody) DataResponse[0] = 0xAB return DataResponse } func main() { } -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/32bf0445-0f95-4e44-bab5-55c83fbe19fan%40googlegroups.com.