mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-06 14:20:55 +03: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
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = writeAtFull(w, buf, writeOffset, int(count))
|
return writeAtFull(w, buf, writeOffset, int(count))
|
||||||
return err
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (fs *AzureBlobFs) handleMultipartDownload(ctx context.Context, blockBlob *blockblob.Client,
|
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
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = writeAtFull(w, buf, writeOffset, int(count))
|
return writeAtFull(w, buf, writeOffset, int(count))
|
||||||
return err
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (fs *S3Fs) handleDownload(ctx context.Context, name string, offset int64, writer io.WriterAt, attrs *s3.HeadObjectOutput) error {
|
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
|
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
|
written := 0
|
||||||
for written < count {
|
for written < count {
|
||||||
n, err := w.WriteAt(buf[written:count], offset+int64(written))
|
n, err := w.WriteAt(buf[written:count], offset+int64(written))
|
||||||
written += n
|
written += n
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return written, err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return written, nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type bytesReaderWrapper struct {
|
type bytesReaderWrapper struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user