orijtech / structslop

structslop is a static analyzer for Go that recommends struct field rearrangements to provide for maximum space/allocation efficiency.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Struct slop detector rules

cuonglm opened this issue · comments

There's an existing tool which does report if the struct is not probably aligned https://github.com/mdempsky/maligned

Things we need to clarify:

  • Is the tool updated?
  • If we can re-use it, is there problem with LICENSE?

I can discuss with Matthew for those things.

Would be nice though to show optimal arrangement suggestions and not just report misalignment.

The license is owned by the Go Authors https://github.com/mdempsky/maligned/blob/6e39bd26a8c8b58c5a22129593044655a9e25959/maligned.go#L1-L3 or at least that’s what Matthew dedicated it for.

Would be nice though to show optimal arrangement suggestions and not just report misalignment.

Ah right, good point.

I think that can be easily done once we detect the misalignment.