Is there a library function to convert a []byte into a struct? I'm working on a client to catch a struct sent from a server written in C.
I have my struct setup like this.
type mystruct struct {
A uint32
B uint16
}
This is how I read the bytes over the wire.
var s []byte = make([]byte, 6)
sock.ReadFromUDP(s)
fmt.Println(s)