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:
@@ -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,
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user