fix staticcheck errors#67
Conversation
| var buf []blocks.Block | ||
| for { | ||
| blk, err := cr.Next() | ||
| switch err { |
There was a problem hiding this comment.
Not sure if there was a reason to use a switch here. Performance maybe, since this is a function that's supposedly "fast"?
If I remember correctly though, switch is not faster than if / else, unless you have a lot of cases.
There was a problem hiding this comment.
I honestly don't think it matters here, either.
For those reading this later, the warning is:
default case should be first or last in switch statement (ST1015)
It's entirely reasonable. I also think the if/else method is simpler.
| var buf []blocks.Block | ||
| for { | ||
| blk, err := cr.Next() | ||
| switch err { |
There was a problem hiding this comment.
I honestly don't think it matters here, either.
For those reading this later, the warning is:
default case should be first or last in switch statement (ST1015)
It's entirely reasonable. I also think the if/else method is simpler.
fix staticcheck errors This commit was moved from ipld/go-car@5da23b6
No description provided.