[Go] Add missing namespace when using Object API (#6633)

This commit is contained in:
mogemimi 2021-05-11 02:52:10 +09:00 committed by GitHub
parent c8c16de167
commit 170af59788
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -1011,7 +1011,9 @@ class GoGenerator : public BaseGenerator {
NativeType(field.value.type) + ", " + length + ")\n"; NativeType(field.value.type) + ", " + length + ")\n";
code += "\tfor j := 0; j < " + length + "; j++ {\n"; code += "\tfor j := 0; j < " + length + "; j++ {\n";
if (field.value.type.element == BASE_TYPE_STRUCT) { if (field.value.type.element == BASE_TYPE_STRUCT) {
code += "\t\tx := " + field.value.type.struct_def->name + "{}\n"; code += "\t\tx := " +
WrapInNameSpaceAndTrack(*field.value.type.struct_def) +
"{}\n";
code += "\t\trcv." + field_name_camel + "(&x, j)\n"; code += "\t\trcv." + field_name_camel + "(&x, j)\n";
} }
code += "\t\tt." + field_name_camel + "[j] = "; code += "\t\tt." + field_name_camel + "[j] = ";