mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-25 18:38:39 +00:00
[Go] Add UnPackTo functions (#5598)
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
32254b7acd
commit
964365ba69
@@ -19,15 +19,19 @@ func Vec3Pack(builder *flatbuffers.Builder, t *Vec3T) flatbuffers.UOffsetT {
|
||||
if t == nil { return 0 }
|
||||
return CreateVec3(builder, t.X, t.Y, t.Z, t.Test1, t.Test2, t.Test3.A, t.Test3.B)
|
||||
}
|
||||
func (rcv *Vec3) UnPack() *Vec3T {
|
||||
if rcv == nil { return nil }
|
||||
t := &Vec3T{}
|
||||
func (rcv *Vec3) UnPackTo(t *Vec3T) {
|
||||
t.X = rcv.X()
|
||||
t.Y = rcv.Y()
|
||||
t.Z = rcv.Z()
|
||||
t.Test1 = rcv.Test1()
|
||||
t.Test2 = rcv.Test2()
|
||||
t.Test3 = rcv.Test3(nil).UnPack()
|
||||
}
|
||||
|
||||
func (rcv *Vec3) UnPack() *Vec3T {
|
||||
if rcv == nil { return nil }
|
||||
t := &Vec3T{}
|
||||
rcv.UnPackTo(t)
|
||||
return t
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user