"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: remove x := x made unnecessary by the new semantics of loops in go1.22
russcossd6f5652b6599
diff --git a/backend/azureblob/azureblob.go b/backend/azureblob/azureblob.goindex 963c11018..1a7e9a008 100644--- a/backend/azureblob/azureblob.go+++ b/backend/azureblob/azureblob.go@@ -2152,7 +2152,6 @@ func (o *Object) getMetadata() (metadata map[string]*string) {}metadata = make(map[string]*string, len(o.meta))for k, v := range o.meta {- v := vmetadata[k] = &v}return metadatadiff --git a/backend/combine/combine.go b/backend/combine/combine.goindex 80e2d6d0f..6c74c343f 100644--- a/backend/combine/combine.go+++ b/backend/combine/combine.go@@ -187,7 +187,6 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (outFs fsg, gCtx := errgroup.WithContext(ctx)var mu sync.Mutexfor _, upstream := range opt.Upstreams {- upstream := upstreamg.Go(func() (err error) {equal := strings.IndexRune(upstream, '=')if equal < 0 {@@ -370,7 +369,6 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (outFs fsfunc (f *Fs) multithread(ctx context.Context, fn func(context.Context, *upstream) error) error {g, gCtx := errgroup.WithContext(ctx)for _, u := range f.upstreams {- u := ug.Go(func() (err error) {return fn(gCtx, u)})@@ -637,7 +635,6 @@ func (f *Fs) ChangeNotify(ctx context.Context, notifyFunc func(string, fs.EntryTvar uChans []chan time.Durationfor _, u := range f.upstreams {- u := uif do := u.f.Features().ChangeNotify; do != nil {ch := make(chan time.Duration)uChans = append(uChans, ch)diff --git a/backend/drive/metadata.go b/backend/drive/metadata.goindex 3f2800e49..2a56ce233 100644--- a/backend/drive/metadata.go+++ b/backend/drive/metadata.go@@ -386,7 +386,6 @@ func (o *baseObject) parseMetadata(ctx context.Context, info *drive.File) (err eg.SetLimit(o.fs.ci.Checkers)var mu sync.Mutex // protect the info.Permissions from concurrent writesfor _, permissionID := range info.PermissionIds {- permissionID := permissionIDg.Go(func() error {// must fetch the team drive ones individually to check the inherited flagperm, inherited, err := o.fs.getPermission(gCtx, actualID(info.Id), permissionID, !o.fs.isTeamDrive)@@ -520,7 +519,6 @@ func (f *Fs) updateMetadata(ctx context.Context, updateInfo *drive.File, meta fs}// merge metadata into request and user metadatafor k, v := range meta {- k, v := k, v// parse a boolean from v and write into outparseBool := func(out *bool) error {b, err := strconv.ParseBool(v)diff --git a/backend/onedrive/metadata.go b/backend/onedrive/metadata.goindex 63f9e7571..2d3476937 100644--- a/backend/onedrive/metadata.go+++ b/backend/onedrive/metadata.go@@ -243,7 +243,6 @@ func (m *Metadata) Get(ctx context.Context) (metadata fs.Metadata, err error) {func (m *Metadata) Set(ctx context.Context, metadata fs.Metadata) (numSet int, err error) {numSet = 0for k, v := range metadata {- k, v := k, vswitch k {case "mtime":t, err := time.Parse(timeFormatIn, v)diff --git a/backend/union/policy/epff.go b/backend/union/policy/epff.goindex e984bf2fd..f6aec0844 100644--- a/backend/union/policy/epff.go+++ b/backend/union/policy/epff.go@@ -21,7 +21,6 @@ func (p *EpFF) epff(ctx context.Context, upstreams []*upstream.Fs, filePath strictx, cancel := context.WithCancel(ctx)defer cancel()for _, u := range upstreams {- u := u // Closurego func() {rfs := u.RootFsremote := path.Join(u.RootPath, filePath)diff --git a/cmd/gitannex/e2e_test.go b/cmd/gitannex/e2e_test.goindex be386d447..ffc630100 100644--- a/cmd/gitannex/e2e_test.go+++ b/cmd/gitannex/e2e_test.go@@ -229,7 +229,6 @@ func TestEndToEnd(t *testing.T) {skipE2eTestIfNecessary(t)for _, mode := range allLayoutModes() {- mode := modet.Run(string(mode), func(t *testing.T) {t.Parallel()@@ -258,7 +257,6 @@ func TestEndToEndMigration(t *testing.T) {}for _, mode := range allLayoutModes() {- mode := modet.Run(string(mode), func(t *testing.T) {t.Parallel()@@ -318,7 +316,6 @@ func TestEndToEndRepoLayoutCompat(t *testing.T) {}for _, mode := range allLayoutModes() {- mode := modet.Run(string(mode), func(t *testing.T) {t.Parallel()diff --git a/cmd/serve/nfs/cache_test.go b/cmd/serve/nfs/cache_test.goindex 6941fde17..2cc4d961e 100644--- a/cmd/serve/nfs/cache_test.go+++ b/cmd/serve/nfs/cache_test.go@@ -66,7 +66,6 @@ func testCacheCRUD(t *testing.T, h *Handler, c Cache, fileName string) {func testCacheThrashDifferent(t *testing.T, h *Handler, c Cache) {var wg sync.WaitGroupfor i := range 100 {- i := iwg.Add(1)go func() {defer wg.Done()@@ -125,7 +124,6 @@ func TestCache(t *testing.T) {}()billyFS := &FS{nil} // place holder billyFSfor _, cacheType := range []handleCache{cacheMemory, cacheDisk, cacheSymlink} {- cacheType := cacheTypet.Run(cacheType.String(), func(t *testing.T) {h := &Handler{vfs: vfs.New(object.MemoryFs, nil),diff --git a/fs/config/rc.go b/fs/config/rc.goindex c87dcb318..62484541c 100644--- a/fs/config/rc.go+++ b/fs/config/rc.go@@ -145,7 +145,6 @@ func rcProviders(ctx context.Context, in rc.Params) (out rc.Params, err error) {func init() {for _, name := range []string{"create", "update", "password"} {- name := nameextraHelp := ""if name == "create" {extraHelp = "- type - type of the new remote\n"diff --git a/fs/list/sorter.go b/fs/list/sorter.goindex cc1d55a5b..b2674b294 100644--- a/fs/list/sorter.go+++ b/fs/list/sorter.go@@ -222,7 +222,6 @@ func (lh *listHelper) send(max int) (err error) {g, gCtx := errgroup.WithContext(lh.ls.ctx)g.SetLimit(lh.ls.ci.Checkers)for i, key := range lh.keys {- i, key := i, key // can remove when go1.22 is minimum versiong.Go(func() error {lh.entries[i], lh.errs[i] = lh.ls.keyToEntry(gCtx, key)return nildiff --git a/fs/operations/rc.go b/fs/operations/rc.goindex cd9160f73..644a947e9 100644--- a/fs/operations/rc.go+++ b/fs/operations/rc.go@@ -160,7 +160,6 @@ func rcAbout(ctx context.Context, in rc.Params) (out rc.Params, err error) {func init() {for _, copy := range []bool{false, true} {- copy := copyname := "Move"if copy {name = "Copy"@@ -217,7 +216,6 @@ func init() {{name: "settier", title: "Changes storage tier or class on all files in the path", noRemote: true},{name: "settierfile", title: "Changes storage tier or class on the single file pointed to", noCommand: true},} {- op := opvar remote, command stringif !op.noRemote {remote = "- remote - a path within that remote e.g. \"dir\"\n"diff --git a/fs/sync/rc.go b/fs/sync/rc.goindex 42ca315f6..6577e498b 100644--- a/fs/sync/rc.go+++ b/fs/sync/rc.go@@ -8,7 +8,6 @@ import (func init() {for _, name := range []string{"sync", "copy", "move"} {- name := namemoveHelp := ""if name == "move" {moveHelp = "- deleteEmptySrcDirs - delete empty src directories if set\n"