Commit a6be1d0d authored by John Luxford's avatar John Luxford Committed by Robert Winslow

[Go] Fix namespaces on enums (#5406)

parent a7e20b19
......@@ -143,7 +143,7 @@ class GoGenerator : public BaseGenerator {
// Construct the name of the type for this enum.
std::string GetEnumTypeName(const EnumDef &enum_def) {
return WrapInNameSpaceAndTrack(cur_name_space_, GoIdentity(enum_def.name));
return WrapInNameSpaceAndTrack(enum_def.defined_namespace, GoIdentity(enum_def.name));
}
// Create a type for the enum values.
......
......@@ -41,15 +41,15 @@ func (rcv *TableInFirstNS) FooTable(obj *NamespaceA__NamespaceB.TableInNestedNS)
return nil
}
func (rcv *TableInFirstNS) FooEnum() EnumInNestedNS {
func (rcv *TableInFirstNS) FooEnum() NamespaceA__NamespaceB.EnumInNestedNS {
o := flatbuffers.UOffsetT(rcv._tab.Offset(6))
if o != 0 {
return EnumInNestedNS(rcv._tab.GetInt8(o + rcv._tab.Pos))
return NamespaceA__NamespaceB.EnumInNestedNS(rcv._tab.GetInt8(o + rcv._tab.Pos))
}
return 0
}
func (rcv *TableInFirstNS) MutateFooEnum(n EnumInNestedNS) bool {
func (rcv *TableInFirstNS) MutateFooEnum(n NamespaceA__NamespaceB.EnumInNestedNS) bool {
return rcv._tab.MutateInt8Slot(6, int8(n))
}
......@@ -72,7 +72,7 @@ func TableInFirstNSStart(builder *flatbuffers.Builder) {
func TableInFirstNSAddFooTable(builder *flatbuffers.Builder, fooTable flatbuffers.UOffsetT) {
builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(fooTable), 0)
}
func TableInFirstNSAddFooEnum(builder *flatbuffers.Builder, fooEnum EnumInNestedNS) {
func TableInFirstNSAddFooEnum(builder *flatbuffers.Builder, fooEnum NamespaceA__NamespaceB.EnumInNestedNS) {
builder.PrependInt8Slot(1, int8(fooEnum), 0)
}
func TableInFirstNSAddFooStruct(builder *flatbuffers.Builder, fooStruct flatbuffers.UOffsetT) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment