mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-07 13:53:38 +00:00
[Go] Fix GenNativeUnionUnPack for imported union type. (#7579)
* Fix GenNativeUnionUnPack for imported union type. * Update test results. Co-authored-by: Derek Bailey <derekbailey@google.com>
This commit is contained in:
@@ -906,7 +906,10 @@ class GoGenerator : public BaseGenerator {
|
||||
const EnumVal &ev = **it2;
|
||||
if (ev.IsZero()) continue;
|
||||
code += "\tcase " + namer_.EnumVariant(enum_def, ev) + ":\n";
|
||||
code += "\t\tx := " + ev.union_type.struct_def->name + "{_tab: table}\n";
|
||||
code += "\t\tvar x " +
|
||||
WrapInNameSpaceAndTrack(*ev.union_type.struct_def) +
|
||||
"\n";
|
||||
code += "\t\tx.Init(table.Bytes, table.Pos)\n";
|
||||
|
||||
code += "\t\treturn &" +
|
||||
WrapInNameSpaceAndTrack(enum_def.defined_namespace,
|
||||
|
||||
Reference in New Issue
Block a user