Use enum types in generated read/mutate methods for Go (#4978)

This commit is contained in:
kostya-sh
2018-10-08 22:25:37 +01:00
committed by Wouter van Oortmerssen
parent 7c3c027295
commit a4c362a1ba
6 changed files with 16 additions and 9 deletions

View File

@@ -26,7 +26,7 @@ func (rcv *TestSimpleTableWithEnum) Table() flatbuffers.Table {
return rcv._tab
}
func (rcv *TestSimpleTableWithEnum) Color() int8 {
func (rcv *TestSimpleTableWithEnum) Color() Color {
o := flatbuffers.UOffsetT(rcv._tab.Offset(4))
if o != 0 {
return rcv._tab.GetInt8(o + rcv._tab.Pos)
@@ -34,7 +34,7 @@ func (rcv *TestSimpleTableWithEnum) Color() int8 {
return 2
}
func (rcv *TestSimpleTableWithEnum) MutateColor(n int8) bool {
func (rcv *TestSimpleTableWithEnum) MutateColor(n Color) bool {
return rcv._tab.MutateInt8Slot(4, n)
}