Skip to content

Commit 3607846

Browse files
files.go - change default buffer size
1 parent 74193f9 commit 3607846

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/files.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,10 @@ func FileStats(filePath string, isRemote bool, sshConfig *SSHConfig) (int, int64
164164

165165
var linesCount int
166166
scanner := bufio.NewScanner(reader)
167+
// Increase buffer size to 10MB
168+
buf := make([]byte, 10*1024*1024) // 10MB buffer
169+
scanner.Buffer(buf, len(buf))
170+
167171
for scanner.Scan() {
168172
linesCount++
169173
}

0 commit comments

Comments
 (0)