mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-16 09:12:22 +00:00
[Go] Generate imports with fixed order (#5340)
* use fixed order for golang imports * grumble
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
bff7ffbc51
commit
b56d60f058
@@ -231,6 +231,15 @@ struct Namespace {
|
||||
size_t from_table; // Part of the namespace corresponds to a message/table.
|
||||
};
|
||||
|
||||
inline bool operator<(const Namespace &a, const Namespace &b) {
|
||||
size_t min_size = std::min(a.components.size(), b.components.size());
|
||||
for (size_t i = 0; i < min_size; ++i) {
|
||||
if (a.components[i] != b.components[i])
|
||||
return a.components[i] < b.components[i];
|
||||
}
|
||||
return a.components.size() < b.components.size();
|
||||
}
|
||||
|
||||
// Base class for all definition types (fields, structs_, enums_).
|
||||
struct Definition {
|
||||
Definition()
|
||||
|
||||
Reference in New Issue
Block a user