mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-14 08:26:59 +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 Test struct {
|
||||
_tab flatbuffers.Struct
|
||||
}
|
||||
@@ -14,17 +15,24 @@ func (rcv *Test) Init(buf []byte, i flatbuffers.UOffsetT) {
|
||||
rcv._tab.Pos = i
|
||||
}
|
||||
|
||||
func (rcv *Test) A() int16 { return rcv._tab.GetInt16(rcv._tab.Pos + flatbuffers.UOffsetT(0)) }
|
||||
func (rcv *Test) MutateA(n int16) bool { return rcv._tab.MutateInt16(rcv._tab.Pos + flatbuffers.UOffsetT(0), n) }
|
||||
|
||||
func (rcv *Test) B() int8 { return rcv._tab.GetInt8(rcv._tab.Pos + flatbuffers.UOffsetT(2)) }
|
||||
func (rcv *Test) MutateB(n int8) bool { return rcv._tab.MutateInt8(rcv._tab.Pos + flatbuffers.UOffsetT(2), n) }
|
||||
func (rcv *Test) A() int16 {
|
||||
return rcv._tab.GetInt16(rcv._tab.Pos + flatbuffers.UOffsetT(0))
|
||||
}
|
||||
func (rcv *Test) MutateA(n int16) bool {
|
||||
return rcv._tab.MutateInt16(rcv._tab.Pos+flatbuffers.UOffsetT(0), n)
|
||||
}
|
||||
|
||||
func (rcv *Test) B() int8 {
|
||||
return rcv._tab.GetInt8(rcv._tab.Pos + flatbuffers.UOffsetT(2))
|
||||
}
|
||||
func (rcv *Test) MutateB(n int8) bool {
|
||||
return rcv._tab.MutateInt8(rcv._tab.Pos+flatbuffers.UOffsetT(2), n)
|
||||
}
|
||||
|
||||
func CreateTest(builder *flatbuffers.Builder, a int16, b int8) flatbuffers.UOffsetT {
|
||||
builder.Prep(2, 4)
|
||||
builder.Pad(1)
|
||||
builder.PrependInt8(b)
|
||||
builder.PrependInt16(a)
|
||||
return builder.Offset()
|
||||
builder.Prep(2, 4)
|
||||
builder.Pad(1)
|
||||
builder.PrependInt8(b)
|
||||
builder.PrependInt16(a)
|
||||
return builder.Offset()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user