summaryrefslogtreecommitdiff
path: root/internal/io/line
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2021-08-28 19:36:46 +0100
committerPaul Buetow <paul@buetow.org>2021-08-28 19:36:46 +0100
commit6d727b9bdbc387c8a5c34406a2c4de9140face38 (patch)
treeb6638220853374536db3d32e862961e4dbaa820a /internal/io/line
parent9883a190109623b64e6d311dc2b462a6eae68003 (diff)
use a byte.Buffer in the file reader
Diffstat (limited to 'internal/io/line')
-rw-r--r--internal/io/line/line.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/internal/io/line/line.go b/internal/io/line/line.go
index 715be34..d306c88 100644
--- a/internal/io/line/line.go
+++ b/internal/io/line/line.go
@@ -1,13 +1,14 @@
package line
import (
+ "bytes"
"fmt"
)
// Line represents a read log line.
type Line struct {
// The content of the log line.
- Content []byte
+ Content *bytes.Buffer
// Until now, how many log lines were processed?
Count uint64
// Sometimes we produce too many log lines so that the client
@@ -25,7 +26,7 @@ type Line struct {
// Return a human readable representation of the followed line.
func (l Line) String() string {
return fmt.Sprintf("Line(Content:%s,TransmittedPerc:%v,Count:%v,SourceID:%s)",
- string(l.Content),
+ l.Content.String(),
l.TransmittedPerc,
l.Count,
l.SourceID)