Fix linter complaints - basically comments

This commit is contained in:
Klaas Freitag 2025-03-26 15:26:22 +01:00
parent 5ce316256e
commit e39d0e99f2
3 changed files with 4 additions and 10 deletions

View File

@ -6,9 +6,9 @@ import (
)
var (
// ErrChuckSize is returned when the chunk size is zero
// ErrChunkSize is returned when the chunk size is zero
ErrChunkSize = errors.New("tus chunk size must be greater than zero")
// ErrNilConfig is returned when the logger is nil
// ErrNilLogger is returned when the logger is nil
ErrNilLogger = errors.New("tus logger can't be nil")
// ErrNilStore is returned when the store is nil
ErrNilStore = errors.New("tus store can't be nil if resume is enable")

View File

@ -40,9 +40,9 @@ func (f *Fs) shouldRetryChunk(ctx context.Context, resp *http.Response, err erro
if off, err := strconv.ParseInt(resp.Header.Get("Upload-Offset"), 10, 64); err == nil {
*newOff = off
return false, nil
} else {
return false, err
}
return false, err
case 409:
return false, ErrOffsetMismatch
case 412:

View File

@ -17,12 +17,6 @@ import (
"github.com/rclone/rclone/lib/rest"
)
// set the chunk size for testing
func (f *Fs) setUploadTusSize(cs fs.SizeSuffix) (old fs.SizeSuffix, err error) {
old, f.opt.ChunkSize = f.opt.ChunkSize, cs
return
}
func (o *Object) updateViaTus(ctx context.Context, in io.Reader, contentType string, src fs.ObjectInfo, options ...fs.OpenOption) (err error) {
fn := filepath.Base(src.Remote())