Update golangci-lint, resolve warnings #285
Labels
No labels
P0
P1
P2
P3
badger
frostfs-adm
frostfs-cli
frostfs-ir
frostfs-lens
frostfs-node
good first issue
triage
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#285
Loading…
Reference in a new issue
No description provided.
Delete branch "fyrchik/frostfs-node:fix-linter"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Let me know if the last commit is too tricky, we can add
nolint
, though I'd like to avoid it.85bb0dc564
toa7d1c97987
@ -33,3 +34,3 @@
func upperPowerOfTwo(v uint64) (upperBound uint64) {
for upperBound = firstBucketBound; upperBound < v; upperBound *= 2 {
if v <= firstBucketBound {
We also have this https://graphics.stanford.edu/~seander/bithacks.html#RoundUpPowerOf2 , but it seems even less readable, though with a solid reference.
@ -36,3 +38,2 @@
}
return
return 1 << (64 - bits.LeadingZeros64(v-1))
You can simplify it a bit:
which is what
bits.LeadingZeros64
does internally anyway.Also, the
upperBound
named return value is not really needed anymore, is it?Fixed
a7d1c97987
to37563c3c6e
well, it took some time for me, so i have to say that it is not as regular as the previous
for
loop. i would keepfor
with some changes but that way looks cool to me too.37563c3c6e
to1f4061c0e2