Add byte slice accessor to Go code

This commit is contained in:
Ben Harper
2015-04-01 16:39:53 +02:00
parent ca5c9e7496
commit 8fb6c4f764
4 changed files with 48 additions and 1 deletions

View File

@@ -75,6 +75,14 @@ func (rcv *Monster) InventoryLength() int {
return 0
}
func (rcv *Monster) InventoryBytes() []byte {
o := flatbuffers.UOffsetT(rcv._tab.Offset(14))
if o != 0 {
return rcv._tab.ByteVector(o + rcv._tab.Pos)
}
return nil
}
func (rcv *Monster) Color() int8 {
o := flatbuffers.UOffsetT(rcv._tab.Offset(16))
if o != 0 {
@@ -140,7 +148,9 @@ func (rcv *Monster) TestarrayofstringLength() int {
}
/// an example documentation comment: this will end up in the generated code
/// multiline too
func (rcv *Monster) Testarrayoftables(obj *Monster, j int) bool {
o := flatbuffers.UOffsetT(rcv._tab.Offset(26))
if o != 0 {
@@ -194,6 +204,14 @@ func (rcv *Monster) TestnestedflatbufferLength() int {
return 0
}
func (rcv *Monster) TestnestedflatbufferBytes() []byte {
o := flatbuffers.UOffsetT(rcv._tab.Offset(30))
if o != 0 {
return rcv._tab.ByteVector(o + rcv._tab.Pos)
}
return nil
}
func (rcv *Monster) Testempty(obj *Stat) *Stat {
o := flatbuffers.UOffsetT(rcv._tab.Offset(32))
if o != 0 {