summaryrefslogtreecommitdiff
path: root/libpod/logs/reversereader/reversereader.go
diff options
context:
space:
mode:
authoropenshift-ci[bot] <75433959+openshift-ci[bot]@users.noreply.github.com>2022-07-05 16:10:12 +0000
committerGitHub <noreply@github.com>2022-07-05 16:10:12 +0000
commit39fc5d1f4f26f82ed1ca23d97f43924335c4c529 (patch)
treee0a54c6d0e3a1bc238cb5ef4a9316b55b39217ee /libpod/logs/reversereader/reversereader.go
parent9539a89ee77682ed3f4d1d0be3b950523e2f2439 (diff)
parent251d91699de4e9aaab53ab6fea262d4b6bdaae8e (diff)
downloadpodman-39fc5d1f4f26f82ed1ca23d97f43924335c4c529.tar.gz
podman-39fc5d1f4f26f82ed1ca23d97f43924335c4c529.tar.bz2
podman-39fc5d1f4f26f82ed1ca23d97f43924335c4c529.zip
Merge pull request #14828 from saschagrunert/errors-libpod
libpod: switch to golang native error wrapping
Diffstat (limited to 'libpod/logs/reversereader/reversereader.go')
-rw-r--r--libpod/logs/reversereader/reversereader.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/libpod/logs/reversereader/reversereader.go b/libpod/logs/reversereader/reversereader.go
index 4fa1a3f88..f2e71fb61 100644
--- a/libpod/logs/reversereader/reversereader.go
+++ b/libpod/logs/reversereader/reversereader.go
@@ -1,10 +1,10 @@
package reversereader
import (
+ "errors"
+ "fmt"
"io"
"os"
-
- "github.com/pkg/errors"
)
// ReverseReader structure for reading a file backwards
@@ -49,12 +49,12 @@ func NewReverseReader(reader *os.File) (*ReverseReader, error) {
// then sets the newoff set one pagesize less than the previous read.
func (r *ReverseReader) Read() (string, error) {
if r.offset < 0 {
- return "", errors.Wrap(io.EOF, "at beginning of file")
+ return "", fmt.Errorf("at beginning of file: %w", io.EOF)
}
// Read from given offset
b := make([]byte, r.readSize)
n, err := r.reader.ReadAt(b, r.offset)
- if err != nil && errors.Cause(err) != io.EOF {
+ if err != nil && !errors.Is(err, io.EOF) {
return "", err
}
if int64(n) < r.readSize {