Closed ramin closed 3 months ago
Attention: 9 lines
in your changes are missing coverage. Please review.
Comparison is base (
28ff21c
) 63.60% compared to head (5137209
) 63.77%.
Files | Patch % | Lines |
---|---|---|
store/heightsub.go | 0.00% | 5 Missing :warning: |
p2p/options.go | 33.33% | 2 Missing :warning: |
headertest/subscriber.go | 0.00% | 1 Missing :warning: |
sync/ranges.go | 50.00% | 1 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Queen's English vs the language of freedom
🤣
unnecessary conversions (lots of uint64 type casting where the return type is/was already uint64)
That's a relic from the time when int64 was used for heights. I thought we cleaned them up but seems like not
@Wondertan re-aligned some back to reflect idioms etc, have a look and point out any others that maybe want some re-jiggling, not too far from original in most cases
IMO it will be better to not merge these changes 'cause Go will start doing this automatically, see accepted proposal https://github.com/golang/go/issues/66408
Agree. Do you mean its fully automatic? My read is that it requires importing and embedding the layout struct
Do you mean its fully automatic?
Of course not. Implicit field from structs
package will reorder fields on a specific platform. By automatically
I meant that we don't need to reorder fields (manually) when fields will be added/removed.
At suggestion and request of @Wondertan, implemented govet field alignment linting for struct alignment/padding checks, and subsequently committed fixes for them, as we did in https://github.com/celestiaorg/celestia-node/pull/2856
Needed to take a bit of a quest to get here, steps from volume 1:
golangci-lint
for the repo (using same .golangci.yml we use in celestia-node)lint
job thatbuild
is now dependent onNow we have lint errors. Volume 2 was fixin'. Fixes for lint errors golangci-lint found that are corrected in this PR:
_test.go
files)Finally, time for Return of the King. We then had "just" the fieldalignment optimizations, which have since been re-aligned. For example, here was the suggested output that was since altered