[GO] Fix support for enums with underscores and Unions with imported members (#5600)

* Fix Enum Stringer method when Enum has underscores

Fixes #5481

* Fix go package importing itself when Union has imported members.
This commit is contained in:
Tiago Silva
2019-11-26 20:25:36 +00:00
committed by Robert Winslow
parent c3c32ec942
commit 3c964e10ab
4 changed files with 91 additions and 91 deletions

View File

@@ -81,13 +81,13 @@ class GoGenerator : public BaseGenerator {
tracked_imported_namespaces_.clear();
needs_imports = false;
std::string enumcode;
GenEnum(**it, &enumcode);
if ((*it)->is_union && parser_.opts.generate_object_based_api) {
GenNativeUnion(**it, &enumcode);
GenNativeUnionPack(**it, &enumcode);
GenNativeUnionUnPack(**it, &enumcode);
needs_imports = true;
}
GenEnum(**it, &enumcode);
if (parser_.opts.one_file) {
one_file_code += enumcode;
} else {