1 // automatically generated by the FlatBuffers compiler, do not modify 2 3 package Example 4 5 import ( 6 flatbuffers "github.com/google/flatbuffers/go" 7 ) 8 9 type Test struct { 10 _tab flatbuffers.Struct 11 } 12 13 func (rcv *Test) Init(buf []byte, i flatbuffers.UOffsetT) { 14 rcv._tab.Bytes = buf 15 rcv._tab.Pos = i 16 } 17 18 func (rcv *Test) Table() flatbuffers.Table { 19 return rcv._tab.Table 20 } 21 22 func (rcv *Test) A() int16 { 23 return rcv._tab.GetInt16(rcv._tab.Pos + flatbuffers.UOffsetT(0)) 24 } 25 func (rcv *Test) MutateA(n int16) bool { 26 return rcv._tab.MutateInt16(rcv._tab.Pos+flatbuffers.UOffsetT(0), n) 27 } 28 29 func (rcv *Test) B() int8 { 30 return rcv._tab.GetInt8(rcv._tab.Pos + flatbuffers.UOffsetT(2)) 31 } 32 func (rcv *Test) MutateB(n int8) bool { 33 return rcv._tab.MutateInt8(rcv._tab.Pos+flatbuffers.UOffsetT(2), n) 34 } 35 36 func CreateTest(builder *flatbuffers.Builder, a int16, b int8) flatbuffers.UOffsetT { 37 builder.Prep(2, 4) 38 builder.Pad(1) 39 builder.PrependInt8(b) 40 builder.PrependInt16(a) 41 return builder.Offset() 42 } 43