mirror of
https://github.com/restic/restic.git
synced 2026-08-06 13:43:18 +00:00
Apply go fix -rangeint ./...
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user