Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update golangci-lint to v1.59.1 #3195

Merged
merged 4 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ linters:
# - lll
- misspell
- nakedret
- nilerr
- noctx
- nolintlint
- perfsprint
Expand Down
2 changes: 1 addition & 1 deletion message/messages_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ func TestMessage(t *testing.T) {
require.Equal(tv.op, encodedMsg.Op())

if bytesSaved := encodedMsg.BytesSavedCompression(); tv.bytesSaved {
require.Greater(bytesSaved, 0)
require.Positive(bytesSaved)
}

parsedMsg, err := mb.parseInbound(encodedMsg.Bytes(), ids.EmptyNodeID, func() {})
Expand Down
2 changes: 1 addition & 1 deletion network/p2p/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ func (r *responder) CrossChainAppRequest(ctx context.Context, chainID ids.ID, re
zap.Uint64("handlerID", r.handlerID),
zap.Binary("message", request),
)
return nil
return nil //nolint:nilerr
}

return r.sender.SendCrossChainAppResponse(ctx, chainID, requestID, appResponse)
Expand Down
2 changes: 1 addition & 1 deletion scripts/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ fi
TESTS=${TESTS:-"golangci_lint license_header require_error_is_no_funcs_as_params single_import interface_compliance_nil require_no_error_inline_func import_testing_only_in_tests"}

function test_golangci_lint {
go install -v github.com/golangci/golangci-lint/cmd/golangci-lint@v1.58.1
go install -v github.com/golangci/golangci-lint/cmd/golangci-lint@v1.59.1
golangci-lint run --config .golangci.yml
}

Expand Down
3 changes: 2 additions & 1 deletion snow/engine/avalanche/getter/getter.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,9 @@ func (gh *getter) GetAncestors(ctx context.Context, nodeID ids.NodeID, requestID
)
vertex, err := gh.storage.GetVtx(ctx, vtxID)
if err != nil || vertex.Status() == choices.Unknown {
// Don't have the requested vertex. Drop message.
gh.log.Verbo("dropping getAncestors")
return nil // Don't have the requested vertex. Drop message.
return nil //nolint:nilerr
}

queue := make([]avalanche.Vertex, 1, gh.maxContainersGetAncestors) // for BFS
Expand Down
6 changes: 4 additions & 2 deletions snow/engine/snowman/transitive.go
Original file line number Diff line number Diff line change
Expand Up @@ -711,8 +711,9 @@ func (t *Transitive) issueFromByID(
) error {
blk, err := t.getBlock(ctx, blkID)
if err != nil {
// If the block is not locally available, request it from the peer.
t.sendRequest(ctx, nodeID, blkID, issuedMetric)
return nil
return nil //nolint:nilerr
StephenButtolph marked this conversation as resolved.
Show resolved Hide resolved
}
return t.issueFrom(ctx, nodeID, blk, issuedMetric)
}
Expand All @@ -738,8 +739,9 @@ func (t *Transitive) issueFrom(
blkID = blk.Parent()
blk, err = t.getBlock(ctx, blkID)
if err != nil {
// If the block is not locally available, request it from the peer.
t.sendRequest(ctx, nodeID, blkID, issuedMetric)
return nil
return nil //nolint:nilerr
}
}

Expand Down
2 changes: 1 addition & 1 deletion tests/fixture/tmpnet/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ func (n *Network) Create(rootDir string) error {
// Ensure the node is configured for use with the network and
// knows where to write its configuration.
if err := n.EnsureNodeConfig(node); err != nil {
return nil
return err
}
}

Expand Down
2 changes: 1 addition & 1 deletion vms/proposervm/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ func (vm *VM) getPostDurangoSlotTime(
switch {
case err == nil:
delay = max(delay, vm.MinBlkDelay)
return parentTimestamp.Add(delay), err
return parentTimestamp.Add(delay), nil
case errors.Is(err, proposer.ErrAnyoneCanPropose):
return parentTimestamp.Add(vm.MinBlkDelay), err
default:
Expand Down
Loading