Move the `i` declaration here:

```go
for i := 0; i < len(buffer); {
```