From 952f124238b470d02e8d37890ebee68d4bf60242 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Sun, 31 Jul 2016 10:30:57 +0200 Subject: [PATCH] Use RandReader instead of rand directly This is a fix to be backwards-compatible with Go < 1.6. --- src/restic/repository/prune_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/restic/repository/prune_test.go b/src/restic/repository/prune_test.go index accd88f14..05277e4c4 100644 --- a/src/restic/repository/prune_test.go +++ b/src/restic/repository/prune_test.go @@ -13,9 +13,9 @@ func randomSize(min, max int) int { } func random(t *testing.T, length int) []byte { - src := rand.New(rand.NewSource(int64(length))) + rd := NewRandReader(rand.New(rand.NewSource(int64(length)))) buf := make([]byte, length) - _, err := io.ReadFull(src, buf) + _, err := io.ReadFull(rd, buf) if err != nil { t.Fatalf("unable to read %d random bytes: %v", length, err) }