From 9fa18c37f7d1dbfaeaa472bc362b53920c5225ab Mon Sep 17 00:00:00 2001 From: Nicola Murino Date: Wed, 19 Nov 2025 19:29:04 +0100 Subject: [PATCH] fix lint warning Signed-off-by: Nicola Murino --- internal/vfs/azblobfs.go | 3 +-- internal/vfs/s3fs.go | 3 +-- internal/vfs/vfs.go | 6 +++--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/internal/vfs/azblobfs.go b/internal/vfs/azblobfs.go index e2129375..a021e23b 100644 --- a/internal/vfs/azblobfs.go +++ b/internal/vfs/azblobfs.go @@ -915,8 +915,7 @@ func (fs *AzureBlobFs) downloadPart(ctx context.Context, blockBlob *blockblob.Cl return err } - _, err = writeAtFull(w, buf, writeOffset, int(count)) - return err + return writeAtFull(w, buf, writeOffset, int(count)) } func (fs *AzureBlobFs) handleMultipartDownload(ctx context.Context, blockBlob *blockblob.Client, diff --git a/internal/vfs/s3fs.go b/internal/vfs/s3fs.go index ce4a1248..744edecb 100644 --- a/internal/vfs/s3fs.go +++ b/internal/vfs/s3fs.go @@ -814,8 +814,7 @@ func (fs *S3Fs) downloadPart(ctx context.Context, name string, buf []byte, w io. return err } - _, err = writeAtFull(w, buf, writeOffset, int(count)) - return err + return writeAtFull(w, buf, writeOffset, int(count)) } func (fs *S3Fs) handleDownload(ctx context.Context, name string, offset int64, writer io.WriterAt, attrs *s3.HeadObjectOutput) error { diff --git a/internal/vfs/vfs.go b/internal/vfs/vfs.go index 3607784f..4e75b58d 100644 --- a/internal/vfs/vfs.go +++ b/internal/vfs/vfs.go @@ -1282,16 +1282,16 @@ func readFill(r io.Reader, buf []byte) (n int, err error) { return n, err } -func writeAtFull(w io.WriterAt, buf []byte, offset int64, count int) (int, error) { +func writeAtFull(w io.WriterAt, buf []byte, offset int64, count int) error { written := 0 for written < count { n, err := w.WriteAt(buf[written:count], offset+int64(written)) written += n if err != nil { - return written, err + return err } } - return written, nil + return nil } type bytesReaderWrapper struct {