Skip to content

Commit

Permalink
Don't use efficientgo wtf
Browse files Browse the repository at this point in the history
Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>
  • Loading branch information
dimitarvdimitrov committed May 4, 2023
1 parent 4cf1925 commit 382a90f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/storegateway/partitioner.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ package storegateway

import (
"encoding/binary"
"errors"
"fmt"
"io"

"github.com/efficientgo/core/errors"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
)
Expand Down Expand Up @@ -151,7 +152,7 @@ var discardBuf [4096]byte
// greater than or equal to the current offset of the reader.
func (r *uvarintSequenceReader) Uvarint(at uint64) (uint64, error) {
if at < r.offset {
return 0, errors.Newf("cannot reverse reader: offset %d, at %d", r.offset, at)
return 0, fmt.Errorf("cannot reverse reader: offset %d, at %d", r.offset, at)
}
for at > r.offset {
b := discardBuf[:]
Expand All @@ -164,7 +165,7 @@ func (r *uvarintSequenceReader) Uvarint(at uint64) (uint64, error) {
break
}
if err != nil {
return 0, errors.Wrap(err, "discarding sequence reader")
return 0, fmt.Errorf("discarding sequence reader: %w", err)
}
}

Expand All @@ -179,7 +180,7 @@ func (r *uvarintSequenceReader) ReadByte() (byte, error) {
return r.b[0], nil
}
if n > 1 {
return 0, errors.Newf("read more than one bytes (%d)", n)
return 0, fmt.Errorf("read more than one bytes (%d)", n)
}
return 0, err
}
Expand Down

0 comments on commit 382a90f

Please sign in to comment.