Golang: how to create a vector of enums #6458
Unanswered
element-of-surprise
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Enums in FlatBuffers are of an integer type (byte, short or int, see the schema), so yes, you would use a loop similar to the former. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I seem to be stumped on how to use a vector of enums from the documentation.
There is this example:
But that seems to be based around bytes representing numbers.
There is this one:
However, the "axe" and "sword" are types that convert to UOffsetT.
In the generated code, I see:
which looks like how I start it. But I can't find anything that converts my enum to a UOffset in order to use the Add().
Thanks for any help you can give.
Beta Was this translation helpful? Give feedback.
All reactions