mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-18 18:48:57 +00:00
Add a generic way to deserialize a flatbuffer in Go.
Similar to what protobufs does with its `Message` interface, introduce here such interface and create a generic `GetRootAs` method to deserialize a flatbuffer.
This commit is contained in:
@@ -23,6 +23,10 @@ func (rcv *Monster) Init(buf []byte, i flatbuffers.UOffsetT) {
|
||||
rcv._tab.Pos = i
|
||||
}
|
||||
|
||||
func (rcv *Monster) Table() flatbuffers.Table {
|
||||
return rcv._tab
|
||||
}
|
||||
|
||||
func (rcv *Monster) Pos(obj *Vec3) *Vec3 {
|
||||
o := flatbuffers.UOffsetT(rcv._tab.Offset(4))
|
||||
if o != 0 {
|
||||
|
||||
Reference in New Issue
Block a user