You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
go prefixedwriter: fix short write error case
In certain cases, formatting as JSON actually reduces the number of bytes.
This leads to the bufio.Writer that wraps this returning `short write` error
because the number of bytes returned is less than expected.
We just want to return the original number of bytes, since we know that we are
doing some string manipulation and we are OK with that.
See: https://pkg.go.dev/io#Writer
```
Write writes len(p) bytes from p to the underlying data stream. It returns the
number of bytes written from p (0 <= n <= len(p)) and any error encountered
that caused the write to stop early. Write must return a non-nil error if it
returns n < len(p).
```