mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-09 14:46:26 +00:00
[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:
committed by
Robert Winslow
parent
c3c32ec942
commit
3c964e10ab
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user