Our great sponsors
-
structslop
structslop is a static analyzer for Go that recommends struct field rearrangements to provide for maximum space/allocation efficiency.
-
I believe I have mentioned structslop just the other day when I have mentioned betteralign. Both fieldalignment (and original maligned) and structslop are great, but there are some smallish details that could be improved upon such as atomic I/O when rewriting source files, ability to skip test and/or generated files or even skip specific specific structs; and automatic GOMAXPROCS and GOMEMLIMIT tuneup when running under containers (such as in some CI pipeline). In any case, if you find this tool something that works for you, I would also appreciate if you could take a look at betteralign.
-
InfluxDB
Access the most powerful time series database as a service. Ingest, store, & analyze all types of time series data in a fully-managed, purpose-built database. Keep data forever with low-cost storage and superior data compression.
-
Official fieldalignment in short erases all comments, due to AST shortcomings when it comes to handling comments. Structslop uses DST (decorated AST) to workaround this problem and has somewhat slightly different algorithm of generated indexes to sort structs.
-
Related posts
- betteralign - structs field alignment static analyzer for Go
- Linter for explicit hint to interface which gets implemented.
- Go 1.20.5 is released
- If you must read the rest of this document to understand the behavior of your program, you are being too clever. Don't be clever.
- Is there a good place to find best practices?