Skip to content

Ordering of fields in Structs is not the same as defined in schema #434

@calmera

Description

@calmera

When generating structs, the order of the fields within the structs are not the same as the properties defined in the schema.

I took a look at the code and it seems that when loading the schema, it is stored in a plain map. Given that go does not guarantee the order of the keys, that already mingles things up.

I also saw some issues and PR's to guarantee reproducibility in the generated assets and I think at some point some alphabetical ordering was implemented on the keys (#54) . While that solved the reproducibility, I think it didn't fix the underlying problem.

Maybe using a SortedMap (like https://github.com/egregors/sortedmap) in the Schema might solve this at the core.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions