Documentation
¶
Overview ¶
A go implementation of Python's Struct module
Example ¶
package main
import (
"fmt"
"github.com/ItzAfroBoy/gostruct"
)
type Data struct {
A int32
B int32
C float32
D float32
E uint8
F uint32
}
func main() {
byteStream := receive() // Data to unpack
packet := Data{}
gostruct.UnpackToStruct("<iiffBI", byteStream, &packet)
fmt.Println(packet)
}
Output:
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UnpackToStruct ¶
Unpack buffer using format string. Populates v using reflect. Buffer contents must match amount of struct fields
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.