From 073ea50f717dc1c2d41c5adb581a11aa49c2752d Mon Sep 17 00:00:00 2001 From: muXxer Date: Mon, 6 May 2024 13:20:32 +0200 Subject: [PATCH] Fix linter errors --- .golangci.yml | 5 ++--- pkg/protocol/commitment.go | 2 +- .../engine/congestioncontrol/scheduler/drr/scheduler.go | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index b17b71756..55bcc68f1 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -58,7 +58,6 @@ linters: - errchkjson - errname - errorlint - - execinquery #- exhaustive #- exhaustruct - exportloopref @@ -77,7 +76,7 @@ linters: #- gocyclo - godot #- godox - - goerr113 + - err113 - gofmt #- gofumpt - goheader @@ -92,7 +91,7 @@ linters: - importas - inamedparam #- interfacebloat - #- intrange # TODO: re-enable after https://github.com/ckaznocha/intrange v0.1.2 release is merged in golangci-lint + - intrange #- ireturn #- lll - loggercheck diff --git a/pkg/protocol/commitment.go b/pkg/protocol/commitment.go index c293db19b..7be3ebf10 100644 --- a/pkg/protocol/commitment.go +++ b/pkg/protocol/commitment.go @@ -103,7 +103,7 @@ func newCommitment(commitments *Commitments, model *model.Commitment) *Commitmen WarpSyncBlocks: reactive.NewVariable[bool](), BlocksToWarpSync: reactive.NewVariable[ds.Set[iotago.BlockID]](), Weight: reactive.NewVariable[uint64](), - AttestedWeight: reactive.NewVariable[uint64](func(currentValue uint64, newValue uint64) uint64 { return max(currentValue, newValue) }), //nolint:gocritic // easier to read + AttestedWeight: reactive.NewVariable[uint64](func(currentValue uint64, newValue uint64) uint64 { return max(currentValue, newValue) }), CumulativeWeight: reactive.NewVariable[uint64](), CumulativeAttestedWeight: reactive.NewVariable[uint64](), CumulativeVerifiedWeight: reactive.NewVariable[uint64](), diff --git a/pkg/protocol/engine/congestioncontrol/scheduler/drr/scheduler.go b/pkg/protocol/engine/congestioncontrol/scheduler/drr/scheduler.go index d9dcf8412..a8dd7c28c 100644 --- a/pkg/protocol/engine/congestioncontrol/scheduler/drr/scheduler.go +++ b/pkg/protocol/engine/congestioncontrol/scheduler/drr/scheduler.go @@ -549,7 +549,7 @@ func (s *Scheduler) removeIssuer(issuerID iotago.AccountID, err error) { return true }) - for i := 0; i < q.readyHeap.Len(); i++ { + for i := range q.readyHeap.Len() { block := q.readyHeap[i].Value block.SetDropped() s.events.BlockDropped.Trigger(block, err)