Skip to content

Commit

Permalink
fix: don't shadow len() built-in
Browse files Browse the repository at this point in the history
Signed-off-by: James Hillyerd <james@hillyerd.com>
  • Loading branch information
jhillyerd committed Feb 11, 2024
1 parent bfb3aa5 commit c3ea06f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions internal/coding/quotedprint_test.go
Expand Up @@ -51,18 +51,18 @@ func TestQPCleanerOverflow(t *testing.T) {
qp := coding.NewQPCleaner(inbuf)

offset := 0
for len := 1000; len > 0; len -= 100 {
p := make([]byte, len)
n, err := qp.Read(p)
for size := 1000; size > 0; size -= 100 {
buf := make([]byte, size)
n, err := qp.Read(buf)
if err != nil {
t.Fatal(err)
}
if n < 1 {
t.Fatalf("Read(p) = %v, wanted >0, at want[%v]", n, offset)
}
for i := 0; i < n; i++ {
if p[i] != want[offset] {
t.Errorf("p[%v] = %q, want: %q (want[%v])", i, p[i], want[offset], offset)
if buf[i] != want[offset] {
t.Errorf("p[%v] = %q, want: %q (want[%v])", i, buf[i], want[offset], offset)
}
offset++
}
Expand Down

0 comments on commit c3ea06f

Please sign in to comment.