"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files
Go azure-blobazure-blob-storageazure-filesbackblaze-b2cloud-storagedropboxencryptionftpfuse-filesystemgogolanggoogle-cloud-storagegoogle-driveonedriveopenstack-swiftrclones3sftpsyncwebdav
build: more pre go1.8 workarounds removed
Nick Craig-Wood8beab1aaf2e1
diff --git a/backend/amazonclouddrive/amazonclouddrive.go b/backend/amazonclouddrive/amazonclouddrive.goindex a61227e23..9eafc6f08 100644--- a/backend/amazonclouddrive/amazonclouddrive.go+++ b/backend/amazonclouddrive/amazonclouddrive.go@@ -32,7 +32,6 @@ import ("github.com/ncw/rclone/lib/dircache""github.com/ncw/rclone/lib/oauthutil""github.com/ncw/rclone/lib/pacer"- "github.com/ncw/rclone/lib/rest""github.com/pkg/errors""golang.org/x/oauth2")@@ -1093,7 +1092,7 @@ func (o *Object) Open(options ...fs.OpenOption) (in io.ReadCloser, err error) {if !bigObject {in, resp, err = file.OpenHeaders(headers)} else {- in, resp, err = file.OpenTempURLHeaders(rest.ClientWithHeaderReset(o.fs.noAuthClient, headers), headers)+ in, resp, err = file.OpenTempURLHeaders(o.fs.noAuthClient, headers)}return o.fs.shouldRetry(resp, err)})diff --git a/cmd/mount/dir.go b/cmd/mount/dir.goindex e95281119..1075cd0c5 100644--- a/cmd/mount/dir.go+++ b/cmd/mount/dir.go@@ -3,6 +3,7 @@package mountimport (+ "context""os""time"@@ -12,7 +13,6 @@ import ("github.com/ncw/rclone/fs/log""github.com/ncw/rclone/vfs""github.com/pkg/errors"- "golang.org/x/net/context" // switch to "context" when we stop supporting go1.8)// Dir represents a directory entrydiff --git a/cmd/mount/file.go b/cmd/mount/file.goindex d03d52d0b..133f51175 100644--- a/cmd/mount/file.go+++ b/cmd/mount/file.go@@ -3,6 +3,7 @@package mountimport (+ "context""io""time"@@ -11,7 +12,6 @@ import ("github.com/ncw/rclone/cmd/mountlib""github.com/ncw/rclone/fs/log""github.com/ncw/rclone/vfs"- "golang.org/x/net/context" // switch to "context" when we stop supporting go1.8)// File represents a filediff --git a/cmd/mount/fs.go b/cmd/mount/fs.goindex 64a8d9d48..b0237605d 100644--- a/cmd/mount/fs.go+++ b/cmd/mount/fs.go@@ -5,6 +5,7 @@package mountimport (+ "context""syscall""bazil.org/fuse"@@ -15,7 +16,6 @@ import ("github.com/ncw/rclone/vfs""github.com/ncw/rclone/vfs/vfsflags""github.com/pkg/errors"- "golang.org/x/net/context" // switch to "context" when we stop supporting go1.8)// FS represents the top level filing systemdiff --git a/cmd/mount/handle.go b/cmd/mount/handle.goindex 5d32a7d7b..2c049abc9 100644--- a/cmd/mount/handle.go+++ b/cmd/mount/handle.go@@ -3,13 +3,13 @@package mountimport (+ "context""io""bazil.org/fuse"fusefs "bazil.org/fuse/fs""github.com/ncw/rclone/fs/log""github.com/ncw/rclone/vfs"- "golang.org/x/net/context" // switch to "context" when we stop supporting go1.8)// FileHandle is an open for read file handle on a Filediff --git a/cmd/serve/webdav/webdav.go b/cmd/serve/webdav/webdav.goindex 88fa90db9..b039f73f5 100644--- a/cmd/serve/webdav/webdav.go+++ b/cmd/serve/webdav/webdav.go@@ -3,6 +3,7 @@package webdavimport (+ "context""net/http""os"@@ -15,7 +16,6 @@ import ("github.com/ncw/rclone/vfs""github.com/ncw/rclone/vfs/vfsflags""github.com/spf13/cobra"- "golang.org/x/net/context" // switch to "context" when we stop supporting go1.8"golang.org/x/net/webdav")diff --git a/lib/rest/rest.go b/lib/rest/rest.goindex e26336560..6c21f6088 100644--- a/lib/rest/rest.go+++ b/lib/rest/rest.go@@ -253,7 +253,7 @@ func (api *Client) Call(opts *Opts) (resp *http.Response, err error) {if opts.NoRedirect {c = ClientWithNoRedirects(api.c)} else {- c = ClientWithHeaderReset(api.c, headers)+ c = api.c}if api.signer != nil {err = api.signer(req)diff --git a/lib/rest/rest_header_reset.go b/lib/rest/rest_header_reset.godeleted file mode 100644index 9557c1d2a..000000000--- a/lib/rest/rest_header_reset.go+++ /dev/null@@ -1,15 +0,0 @@-//+build go1.8--package rest--import (- "net/http"-)--// ClientWithHeaderReset makes a new http client which resets the-// headers passed in on redirect-//-// This is now unnecessary with go1.8 so becomes a no-op-func ClientWithHeaderReset(c *http.Client, headers map[string]string) *http.Client {- return c-}diff --git a/lib/rest/rest_header_reset_go17.go b/lib/rest/rest_header_reset_go17.godeleted file mode 100644index 7b3109b57..000000000--- a/lib/rest/rest_header_reset_go17.go+++ /dev/null@@ -1,33 +0,0 @@-//+build !go1.8--package rest--import (- "net/http"-- "github.com/pkg/errors"-)--// ClientWithHeaderReset makes a new http client which resets the-// headers passed in on redirect-//-// This is only needed for go < go1.8-func ClientWithHeaderReset(c *http.Client, headers map[string]string) *http.Client {- if len(headers) == 0 {- return c- }- clientCopy := *c- clientCopy.CheckRedirect = func(req *http.Request, via []*http.Request) error {- if len(via) >= 10 {- return errors.New("stopped after 10 redirects")- }- // Reset the headers in the new request- for k, v := range headers {- if v != "" {- req.Header.Set(k, v)- }- }- return nil- }- return &clientCopy-}diff --git a/lib/rest/url_test.go b/lib/rest/url_test.goindex 7a7e51bdf..3f481dfd9 100644--- a/lib/rest/url_test.go+++ b/lib/rest/url_test.go@@ -1,5 +1,3 @@-// +build go1.8-package restimport (