Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

build: fix gosimple lint errors with golangci-lint v1.60.1

Nick Craig-Wood9d5315a944c8
diff --git a/backend/chunker/chunker.go b/backend/chunker/chunker.go
index 5fcb0abd3..7b1df95c1 100644
--- a/backend/chunker/chunker.go
+++ b/backend/chunker/chunker.go
@@ -987,7 +987,7 @@ func (f *Fs) scanObject(ctx context.Context, remote string, quickScan bool) (fs.
}
}
- if o.main == nil && (o.chunks == nil || len(o.chunks) == 0) {
+ if o.main == nil && len(o.chunks) == 0 {
// Scanning hasn't found data chunks with conforming names.
if f.useMeta || quickScan {
// Metadata is required but absent and there are no chunks.
diff --git a/backend/seafile/webapi.go b/backend/seafile/webapi.go
index 1cc05a14b..967dbabf0 100644
--- a/backend/seafile/webapi.go
+++ b/backend/seafile/webapi.go
@@ -62,7 +62,7 @@ func getAuthorizationToken(ctx context.Context, srv *rest.Client, user, password
// This is only going to be http errors here
return "", fmt.Errorf("failed to authenticate: %w", err)
}
- if result.Errors != nil && len(result.Errors) > 0 {
+ if len(result.Errors) > 0 {
return "", errors.New(strings.Join(result.Errors, ", "))
}
if result.Token == "" {
diff --git a/lib/rest/rest.go b/lib/rest/rest.go
index 627f0585c..20ee75cb8 100644
--- a/lib/rest/rest.go
+++ b/lib/rest/rest.go
@@ -238,7 +238,7 @@ func (api *Client) Call(ctx context.Context, opts *Opts) (resp *http.Response, e
return nil, errors.New("RootURL not set")
}
url += opts.Path
- if opts.Parameters != nil && len(opts.Parameters) > 0 {
+ if len(opts.Parameters) > 0 {
url += "?" + opts.Parameters.Encode()
}
body := readers.NoCloser(opts.Body)