Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions pkg/result/processors/autogenerated_exclude.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,15 @@ func getDoc(filePath string) (string, error) {
defer file.Close()

scanner := bufio.NewScanner(file)

// Issue 954: Some lines can be very long, e.g. auto-generated
// embedded resources. Reported on file of 86.2KB.
const (
maxSize = 512 * 1024 // 512KB should be enough
initialSize = 4096 // same as startBufSize in bufio
)
scanner.Buffer(make([]byte, initialSize), maxSize)

var docLines []string
for scanner.Scan() {
line := strings.TrimSpace(scanner.Text())
Expand Down