From 82f64072d28ae4f74c0c7258aae55e73375400f4 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Sat, 3 Dec 2022 22:01:51 -0800 Subject: [PATCH] lib/filestream: remove logging redundant path values in a single error message --- lib/filestream/filestream.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/filestream/filestream.go b/lib/filestream/filestream.go index 8af10f5ce..2f0e4e595 100644 --- a/lib/filestream/filestream.go +++ b/lib/filestream/filestream.go @@ -79,7 +79,7 @@ func OpenReaderAt(path string, offset int64, nocache bool) (*Reader, error) { func Open(path string, nocache bool) (*Reader, error) { f, err := os.Open(path) if err != nil { - return nil, fmt.Errorf("cannot open file %q: %w", path, err) + return nil, err } r := &Reader{ f: f, @@ -179,7 +179,7 @@ type Writer struct { func OpenWriterAt(path string, offset int64, nocache bool) (*Writer, error) { f, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE, 0600) if err != nil { - return nil, fmt.Errorf("cannot open %q: %w", path, err) + return nil, err } n, err := f.Seek(offset, io.SeekStart) if err != nil {