Auto fix fieldalignment with this tool at the end of generation steps #1895
frederikhors
started this conversation in
Ideas
Replies: 1 comment
-
Here is a start @frederikhors: #2069 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What happened?
In generated code we have a lot of structs with misaligned fields (the issue is well described here: https://qvault.io/golang/struct-field-ordering-memory/).
What did you expect?
To auto-fix this we can launch at the end of generation this tool:
go install golang.org/x/tools/go/analysis/passes/fieldalignment/cmd/fieldalignment@latest
with this command:
I don't know how to create a PR for this otherwise I would have already done it.
Thanks for your precious work!
Beta Was this translation helpful? Give feedback.
All reactions