I have a struct in go:
type header struct {
dataLength uint16
optDataLength uint8
packetType uint8
}
type packet struct {
syncByte uint8
header *header
headerCrc uint8
data []byte
optData []byte
dataCrc uint8
}
If i have created an Encode and Decode function for creating packages and for encoding them into binary. However why does those two instances.header differ?
&{syncByte:85 header:0xc2080004b8 headerCrc:112 data:[2] optData:[] dataCrc:14}
&{syncByte:85 header:0xc2080004f8 headerCrc:112 data:[2] optData:[] dataCrc:14}
If i run Println on those two header's i get:
&{dataLength:1 optDataLength:0 packetType:5}
&{dataLength:1 optDataLength:0 packetType:5}
which to mee seems equal. But why do they look like 0xc2080004f8 vs 0xc2080004b8 when i cannot see the difference when i check on packet.header directly?