1
0
mirror of https://github.com/drakkan/sftpgo.git synced 2025-11-23 22:04:50 +02:00

fix lint warning

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2025-11-19 19:29:04 +01:00
parent 4230da8e7d
commit 9fa18c37f7
3 changed files with 5 additions and 7 deletions

View File

@@ -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,

View File

@@ -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 {

View File

@@ -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 {