I have a net/socket open. I need to read a structured protocol off the wire. Ie I have
messagelength|type|value|type|value ...
where messagelength is 4 bytes, type one byte, value depends on type,...
I am trying to work out the no-brainer way of doing this in go. I am swamped by io,bufio,encoding... I cant find the right place to start and cant find samples. Looking for ReadInt32, ReadByte,....
Next thing - i need to assemble a reply -> WriteInt32, WriteString, WriteByte,....
Trying to convert python to go, python code uses struct.unpack / pack