Commit 9c3a422a authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Simplify randomLengthString.

parent d6d71a87
...@@ -685,12 +685,10 @@ func TestReadLarge(t *testing.T) { ...@@ -685,12 +685,10 @@ func TestReadLarge(t *testing.T) {
func randomLengthString(length int) string { func randomLengthString(length int) string {
r := rand.Intn(length) r := rand.Intn(length)
j := 0
b := make([]byte, r) b := make([]byte, r)
for i := 0; i < r; i++ { for i := 0; i < r; i++ {
j = (j + 1) % 10 b[i] = byte(i%10) + byte('0')
b[i] = byte(j) + byte('0')
} }
return string(b) return string(b)
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment