mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-09 22:56:27 +00:00
Make most of the Go code comply with gofmt (except enums).
Enums are not fixed because depending on they have comments or not they will be aligned alogn the asssignment character.
This commit is contained in:
@@ -5,6 +5,7 @@ package Example
|
||||
import (
|
||||
flatbuffers "github.com/google/flatbuffers/go"
|
||||
)
|
||||
|
||||
type Stat struct {
|
||||
_tab flatbuffers.Table
|
||||
}
|
||||
@@ -12,7 +13,7 @@ type Stat struct {
|
||||
func GetRootAsStat(buf []byte, offset flatbuffers.UOffsetT) *Stat {
|
||||
n := flatbuffers.GetUOffsetT(buf[offset:])
|
||||
x := &Stat{}
|
||||
x.Init(buf, n + offset)
|
||||
x.Init(buf, n+offset)
|
||||
return x
|
||||
}
|
||||
|
||||
@@ -53,8 +54,18 @@ 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) }
|
||||
func StatAddCount(builder *flatbuffers.Builder, count uint16) { builder.PrependUint16Slot(2, count, 0) }
|
||||
func StatEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { return builder.EndObject() }
|
||||
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)
|
||||
}
|
||||
func StatAddCount(builder *flatbuffers.Builder, count uint16) {
|
||||
builder.PrependUint16Slot(2, count, 0)
|
||||
}
|
||||
func StatEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
|
||||
return builder.EndObject()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user