You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@thomasmodeneis The package is working as intended. It warns you that your ASDExchanger struct layout is inefficient.
Long story short, the fields of your struct are word aligned. On a x64 machines that means they are padded to 8 bytes. What maligned is telling you is that your struct size is 280 bytes while it could be 248 if you re-organized your fields.
The reason you do not get a warning if you replace bool by string is that in that case there are no possible optimizations.
If you do not want to get a warning for that structure, you should move the bool fields to the end of your struct.
Now, the question is whether you actually want to do that. Grouping fields together as you did improve readability. If performance isn't an absolute priority then I would just leave it that way. It's a good trade-off.
You should read the following if you want to know more:
Given the code:
model.go
When I run gometalinter and maligned:
Then throws me err:
When I remove the bool and or replace with string, it works with no errs.
Any ideas ?
The text was updated successfully, but these errors were encountered: