mirror of
https://github.com/drakkan/sftpgo.git
synced 2026-03-14 14:25:52 +01:00
fix lint warning
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
parent
4230da8e7d
commit
9fa18c37f7
3 changed files with 5 additions and 7 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue