Skip to content

Commit

Permalink
bug: mem leak
Browse files Browse the repository at this point in the history
  • Loading branch information
kevincobain2000 committed Jan 9, 2025
1 parent 45dc7a9 commit 90d7cbc
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions pkg/watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ type ScanResult struct {
LastDate string
}

var lines = []string{}

func (w *Watcher) Scan() (*ScanResult, error) {
matchCounts := 0
firstLine := ""
Expand Down Expand Up @@ -109,7 +107,6 @@ func (w *Watcher) Scan() (*ScanResult, error) {
bytesRead := w.lastFileSize

for scanner.Scan() {
lines = append(lines, scanner.Text())
line := scanner.Bytes()
bytesRead += int64(len(line)) + 1 // Adding 1 for the newline character
currentLineNum++
Expand Down

0 comments on commit 90d7cbc

Please sign in to comment.