"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
staticcheck: google api New is deprecated: please use NewService instead
albertonye5bf6a813c75
diff --git a/backend/drive/drive.go b/backend/drive/drive.goindex 4e17f09df..baf2be267 100644--- a/backend/drive/drive.go+++ b/backend/drive/drive.go@@ -51,6 +51,7 @@ import (drive_v2 "google.golang.org/api/drive/v2"drive "google.golang.org/api/drive/v3""google.golang.org/api/googleapi"+ "google.golang.org/api/option")// Constants@@ -1210,13 +1211,13 @@ func newFs(ctx context.Context, name, path string, m configmap.Mapper) (*Fs, err// Create a new authorized Drive client.f.client = oAuthClient- f.svc, err = drive.New(f.client)+ f.svc, err = drive.NewService(context.Background(), option.WithHTTPClient(f.client))if err != nil {return nil, fmt.Errorf("couldn't create Drive client: %w", err)}if f.opt.V2DownloadMinSize >= 0 {- f.v2Svc, err = drive_v2.New(f.client)+ f.v2Svc, err = drive_v2.NewService(context.Background(), option.WithHTTPClient(f.client))if err != nil {return nil, fmt.Errorf("couldn't create Drive v2 client: %w", err)}@@ -2992,12 +2993,12 @@ func (f *Fs) changeServiceAccountFile(ctx context.Context, file string) (err errreturn fmt.Errorf("drive: failed when making oauth client: %w", err)}f.client = oAuthClient- f.svc, err = drive.New(f.client)+ f.svc, err = drive.NewService(context.Background(), option.WithHTTPClient(f.client))if err != nil {return fmt.Errorf("couldn't create Drive client: %w", err)}if f.opt.V2DownloadMinSize >= 0 {- f.v2Svc, err = drive_v2.New(f.client)+ f.v2Svc, err = drive_v2.NewService(context.Background(), option.WithHTTPClient(f.client))if err != nil {return fmt.Errorf("couldn't create Drive v2 client: %w", err)}diff --git a/backend/googlecloudstorage/googlecloudstorage.go b/backend/googlecloudstorage/googlecloudstorage.goindex e010dfd88..b11771d1b 100644--- a/backend/googlecloudstorage/googlecloudstorage.go+++ b/backend/googlecloudstorage/googlecloudstorage.go@@ -44,6 +44,7 @@ import ("golang.org/x/oauth2""golang.org/x/oauth2/google""google.golang.org/api/googleapi"+ option "google.golang.org/api/option"// NOTE: This API is deprecatedstorage "google.golang.org/api/storage/v1"@@ -524,7 +525,7 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e// Create a new authorized Drive client.f.client = oAuthClient- f.svc, err = storage.New(f.client)+ f.svc, err = storage.NewService(context.Background(), option.WithHTTPClient(f.client))if err != nil {return nil, fmt.Errorf("couldn't create Google Cloud Storage client: %w", err)}