From c5e2d37337c8d84177111629083ec31e974816bd Mon Sep 17 00:00:00 2001 From: David Reiss Date: Mon, 20 May 2019 14:46:36 -0700 Subject: [Go] Change two more sites to use enum types (#5359) Fixes #5357 (regression introduced by #5235) --- src/idl_gen_go.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/idl_gen_go.cpp') diff --git a/src/idl_gen_go.cpp b/src/idl_gen_go.cpp index 7987d90a..6556741e 100644 --- a/src/idl_gen_go.cpp +++ b/src/idl_gen_go.cpp @@ -497,7 +497,7 @@ class GoGenerator : public BaseGenerator { std::string &code = *code_ptr; code += std::string(", ") + nameprefix; code += GoIdentity(field.name); - code += " " + GenTypeBasic(field.value.type); + code += " " + TypeName(field); } } } @@ -525,7 +525,7 @@ class GoGenerator : public BaseGenerator { (nameprefix + (field.name + "_")).c_str(), code_ptr); } else { code += "\tbuilder.Prepend" + GenMethod(field) + "("; - code += nameprefix + GoIdentity(field.name) + ")\n"; + code += CastToBaseType(field.value.type, nameprefix + GoIdentity(field.name)) + ")\n"; } } } @@ -556,7 +556,7 @@ class GoGenerator : public BaseGenerator { if (!IsScalar(field.value.type.base_type) && (!struct_def.fixed)) { code += "flatbuffers.UOffsetT"; } else { - code += GenTypeBasic(field.value.type); + code += TypeName(field); } code += ") {\n"; code += "\tbuilder.Prepend"; @@ -567,7 +567,7 @@ class GoGenerator : public BaseGenerator { code += "("; code += GoIdentity(field.name) + ")"; } else { - code += GoIdentity(field.name); + code += CastToBaseType(field.value.type, GoIdentity(field.name)); } code += ", " + GenConstant(field); code += ")\n}\n"; -- cgit v1.2.3