diff --git a/backend/azureblob/azureblob.go b/backend/azureblob/azureblob.go index 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 := v metadata[k] = &v } return metadata diff --git a/backend/combine/combine.go b/backend/combine/combine.go index 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 fs g, gCtx := errgroup.WithContext(ctx) var mu sync.Mutex for _, upstream := range opt.Upstreams { - upstream := upstream g.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 fs func (f *Fs) multithread(ctx context.Context, fn func(context.Context, *upstream) error) error { g, gCtx := errgroup.WithContext(ctx) for _, u := range f.upstreams { - u := u g.Go(func() (err error) { return fn(gCtx, u) }) @@ -637,7 +635,6 @@ func (f *Fs) ChangeNotify(ctx context.Context, notifyFunc func(string, fs.EntryT var uChans []chan time.Duration for _, u := range f.upstreams { - u := u if 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.go index 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 e g.SetLimit(o.fs.ci.Checkers) var mu sync.Mutex // protect the info.Permissions from concurrent writes for _, permissionID := range info.PermissionIds { - permissionID := permissionID g.Go(func() error { // must fetch the team drive ones individually to check the inherited flag perm, 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 metadata for k, v := range meta { - k, v := k, v // parse a boolean from v and write into out parseBool := func(out *bool) error { b, err := strconv.ParseBool(v) diff --git a/backend/onedrive/metadata.go b/backend/onedrive/metadata.go index 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 = 0 for k, v := range metadata { - k, v := k, v switch k { case "mtime": t, err := time.Parse(timeFormatIn, v) diff --git a/backend/union/policy/epff.go b/backend/union/policy/epff.go index 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 stri ctx, cancel := context.WithCancel(ctx) defer cancel() for _, u := range upstreams { - u := u // Closure go func() { rfs := u.RootFs remote := path.Join(u.RootPath, filePath) diff --git a/cmd/gitannex/e2e_test.go b/cmd/gitannex/e2e_test.go index 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 := mode t.Run(string(mode), func(t *testing.T) { t.Parallel() @@ -258,7 +257,6 @@ func TestEndToEndMigration(t *testing.T) { } for _, mode := range allLayoutModes() { - mode := mode t.Run(string(mode), func(t *testing.T) { t.Parallel() @@ -318,7 +316,6 @@ func TestEndToEndRepoLayoutCompat(t *testing.T) { } for _, mode := range allLayoutModes() { - mode := mode t.Run(string(mode), func(t *testing.T) { t.Parallel() diff --git a/cmd/serve/nfs/cache_test.go b/cmd/serve/nfs/cache_test.go index 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.WaitGroup for i := range 100 { - i := i wg.Add(1) go func() { defer wg.Done() @@ -125,7 +124,6 @@ func TestCache(t *testing.T) { }() billyFS := &FS{nil} // place holder billyFS for _, cacheType := range []handleCache{cacheMemory, cacheDisk, cacheSymlink} { - cacheType := cacheType t.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.go index 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 := name extraHelp := "" if name == "create" { extraHelp = "- type - type of the new remote\n" diff --git a/fs/list/sorter.go b/fs/list/sorter.go index 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 version g.Go(func() error { lh.entries[i], lh.errs[i] = lh.ls.keyToEntry(gCtx, key) return nil diff --git a/fs/operations/rc.go b/fs/operations/rc.go index 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 := copy name := "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 := op var remote, command string if !op.noRemote { remote = "- remote - a path within that remote e.g. \"dir\"\n" diff --git a/fs/sync/rc.go b/fs/sync/rc.go index 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 := name moveHelp := "" if name == "move" { moveHelp = "- deleteEmptySrcDirs - delete empty src directories if set\n"