Skip to content

Commit

Permalink
fix: check r.err != nil but return a nil value error err (#13120)
Browse files Browse the repository at this point in the history
the `err` has been checked. so it's value must be nil, so should return
`r.err`

I have an idea to detect code that returns a non-relevant nilness error
bug. I checked the top 1000 GitHub Go repositories and found this, all
result listed in alingse/sundrylint#4

Signed-off-by: alingse <[email protected]>
  • Loading branch information
alingse authored Dec 17, 2024
1 parent b0578e6 commit 4590301
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion eth/stagedsync/stage_polygon_sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -1039,7 +1039,7 @@ func (s polygonSyncStageBridgeStore) LastEventIdWithinWindow(ctx context.Context
return 0, err
}
if r.err != nil {
return 0, err
return 0, r.err
}

return r.id, nil
Expand Down

0 comments on commit 4590301

Please sign in to comment.