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:
gonzaloserrano
2016-07-07 12:46:39 +02:00
parent b36bd67b39
commit 199a49b5b3
9 changed files with 236 additions and 140 deletions

View File

@@ -22,6 +22,10 @@ func (rcv *Monster) Init(buf []byte, i flatbuffers.UOffsetT) {
rcv._tab.Pos = i
}
func (rcv *Monster) Table() flatbuffers.Table {
return rcv._tab
}
func MonsterStart(builder *flatbuffers.Builder) {
builder.StartObject(0)
}