mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-10 15:16:28 +00:00
Implement mutators for Go
This commit is contained in:
@@ -30,6 +30,10 @@ func (rcv *Stat) Val() int64 {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (rcv *Stat) MutateVal(n int64) bool {
|
||||
return rcv._tab.MutateInt64Slot(6, n)
|
||||
}
|
||||
|
||||
func (rcv *Stat) Count() uint16 {
|
||||
o := flatbuffers.UOffsetT(rcv._tab.Offset(8))
|
||||
if o != 0 {
|
||||
@@ -38,6 +42,10 @@ func (rcv *Stat) Count() uint16 {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (rcv *Stat) MutateCount(n uint16) bool {
|
||||
return rcv._tab.MutateUint16Slot(8, n)
|
||||
}
|
||||
|
||||
func StatStart(builder *flatbuffers.Builder) { builder.StartObject(3) }
|
||||
func StatAddId(builder *flatbuffers.Builder, id flatbuffers.UOffsetT) { builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(id), 0) }
|
||||
func StatAddVal(builder *flatbuffers.Builder, val int64) { builder.PrependInt64Slot(1, val, 0) }
|
||||
|
||||
Reference in New Issue
Block a user