Apply go fix -rangeint ./...

This commit is contained in:
Michael Eischer
2026-07-22 22:26:19 +02:00
parent fb36a7f59b
commit 2c169edad4
56 changed files with 91 additions and 91 deletions
+2 -2
View File
@@ -88,7 +88,7 @@ func TestFindUsedBlobs(t *testing.T) {
repo := repository.TestRepository(t)
var snapshots []*data.Snapshot
for i := 0; i < findTestSnapshots; i++ {
for i := range findTestSnapshots {
sn := data.TestCreateSnapshot(t, repo, findTestTime.Add(time.Duration(i)*time.Second), findTestDepth)
t.Logf("snapshot %v saved, tree %v", sn.ID().Str(), sn.Tree.Str())
snapshots = append(snapshots, sn)
@@ -131,7 +131,7 @@ func TestMultiFindUsedBlobs(t *testing.T) {
repo := repository.TestRepository(t)
var snapshotTrees restic.IDs
for i := 0; i < findTestSnapshots; i++ {
for i := range findTestSnapshots {
sn := data.TestCreateSnapshot(t, repo, findTestTime.Add(time.Duration(i)*time.Second), findTestDepth)
t.Logf("snapshot %v saved, tree %v", sn.ID().Str(), sn.Tree.Str())
snapshotTrees = append(snapshotTrees, *sn.Tree)
+1 -1
View File
@@ -75,7 +75,7 @@ func (fs *fakeFileSystem) saveTree(ctx context.Context, uploader restic.BlobSave
numNodes := int(rnd.Int63() % maxNodes)
var nodes []*Node
for i := 0; i < numNodes; i++ {
for i := range numNodes {
// randomly select the type of the node, either tree (p = 1/4) or file (p = 3/4).
if depth > 1 && rnd.Int63()%4 == 0 {
treeSeed := rnd.Int63() % maxSeed
+1 -1
View File
@@ -20,7 +20,7 @@ const (
func TestCreateSnapshot(t *testing.T) {
repo := repository.TestRepository(t)
for i := 0; i < testCreateSnapshots; i++ {
for i := range testCreateSnapshots {
data.TestCreateSnapshot(t, repo, testSnapshotTime.Add(time.Duration(i)*time.Second), testDepth)
}
+1 -1
View File
@@ -201,7 +201,7 @@ func StreamTrees(
// decoding a tree can take quite some time such that this can be both CPU- or IO-bound
// one extra worker to handle huge tree blobs
workerCount := int(repo.Connections()) + runtime.GOMAXPROCS(0) + 1
for i := 0; i < workerCount; i++ {
for i := range workerCount {
workerLoaderChan := loaderChan
if i == 0 {
workerLoaderChan = hugeTreeChan