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

Fix new lint issues reported by golangci-lint v1.59.0

albertony3f3e4b055e32
diff --git a/backend/webdav/webdav_internal_test.go b/backend/webdav/webdav_internal_test.go
index 20dee468b..c2c2d1dfa 100644
--- a/backend/webdav/webdav_internal_test.go
+++ b/backend/webdav/webdav_internal_test.go
@@ -29,7 +29,7 @@ func prepareServer(t *testing.T) (configmap.Simple, func()) {
what := fmt.Sprintf("%s %s: Header ", r.Method, r.URL.Path)
assert.Equal(t, headers[1], r.Header.Get(headers[0]), what+headers[0])
assert.Equal(t, headers[3], r.Header.Get(headers[2]), what+headers[2])
- fmt.Fprintf(w, `<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:oc="http://owncloud.org/ns" xmlns:nc="http://nextcloud.org/ns">
+ _, err := fmt.Fprintf(w, `<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:oc="http://owncloud.org/ns" xmlns:nc="http://nextcloud.org/ns">
<d:response>
<d:href>/remote.php/webdav/</d:href>
<d:propstat>
@@ -41,8 +41,8 @@ func prepareServer(t *testing.T) (configmap.Simple, func()) {
</d:propstat>
</d:response>
</d:multistatus>`)
+ require.NoError(t, err)
})
-
// Make the test server
ts := httptest.NewServer(handler)
diff --git a/fs/config/configfile/configfile_test.go b/fs/config/configfile/configfile_test.go
index 2c2ba7e27..8ec7cd518 100644
--- a/fs/config/configfile/configfile_test.go
+++ b/fs/config/configfile/configfile_test.go
@@ -190,7 +190,8 @@ func TestConfigFileReload(t *testing.T) {
// Now write a new value on the end
out, err := os.OpenFile(config.GetConfigPath(), os.O_APPEND|os.O_WRONLY, 0777)
require.NoError(t, err)
- fmt.Fprintln(out, "appended = what magic")
+ _, err = fmt.Fprintln(out, "appended = what magic")
+ require.NoError(t, err)
require.NoError(t, out.Close())
// And check we magically reloaded it