fix: extra line break in the last chunk

This commit is contained in:
Danil Solovyov 2023-10-01 02:23:27 +05:00
parent 27a06a2043
commit b913909168

@ -29,7 +29,7 @@ func (r *LineWriter) Write(p []byte) (n int, err error) {
var chunk []byte
chunk = append(chunk, p[i:end]...)
if len(p) >= r.length {
if len(p) >= end+r.length {
chunk = append(chunk, []byte("\r\n")...)
}