diff --git a/src/restic/test/helpers.go b/src/restic/test/helpers.go index 072cc4db9..4e19000e8 100644 --- a/src/restic/test/helpers.go +++ b/src/restic/test/helpers.go @@ -79,7 +79,7 @@ func Random(seed, count int) []byte { for j := range data { cur := i + j - if len(p) >= cur { + if cur >= len(p) { break } p[cur] = data[j]