Skip to content

Commit

Permalink
add comment about why ignore error
Browse files Browse the repository at this point in the history
  • Loading branch information
tac0turtle committed Nov 18, 2019
1 parent 9c25a67 commit 17b62f1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions prefix_db.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,10 @@ type prefixIterator struct {
}

func newPrefixIterator(prefix, start, end []byte, source Iterator) *prefixIterator {
// Ignoring the error here as the iterator is invalid
// but this is being conveyed in the below if statement
key, _ := source.Key() //nolint:errcheck

if !source.Valid() || !bytes.HasPrefix(key, prefix) {
return &prefixIterator{
prefix: prefix,
Expand Down

0 comments on commit 17b62f1

Please sign in to comment.