Merge pull request #363 from danring/fix-341

Emit GetRootAs methods for all types in Go and Python
This commit is contained in:
Robert
2016-07-22 15:12:35 -07:00
committed by GitHub
9 changed files with 80 additions and 10 deletions

View File

@@ -9,6 +9,13 @@ type TestSimpleTableWithEnum struct {
_tab flatbuffers.Table
}
func GetRootAsTestSimpleTableWithEnum(buf []byte, offset flatbuffers.UOffsetT) *TestSimpleTableWithEnum {
n := flatbuffers.GetUOffsetT(buf[offset:])
x := &TestSimpleTableWithEnum{}
x.Init(buf, n + offset)
return x
}
func (rcv *TestSimpleTableWithEnum) Init(buf []byte, i flatbuffers.UOffsetT) {
rcv._tab.Bytes = buf
rcv._tab.Pos = i