Skip to content

Commit 5359df6

Browse files
committed
trim both carriage return and newline
1 parent c7873ce commit 5359df6

File tree

1 file changed

+1
-5
lines changed
  • internal/component/loki/source/file/internal/tail

1 file changed

+1
-5
lines changed

internal/component/loki/source/file/internal/tail/file.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,7 @@ func (f *File) readLine() (string, error) {
167167
if err != nil {
168168
return line, err
169169
}
170-
171-
line = strings.TrimRight(line, "\n")
172-
// Trim Windows line endings
173-
line = strings.TrimSuffix(line, "\r")
174-
return line, err
170+
return strings.TrimRight(line, "\r\n"), err
175171
}
176172

177173
// offset returns the current byte offset in the file where the next read will occur.

0 commit comments

Comments
 (0)