Merge pull request #976 from golangci/increase-scanner-buffer

autogenerated_exclude: increase scanner max buffer size
This commit is contained in:
Aleksandr Razumov 2020-02-28 14:41:20 +03:00 committed by GitHub
commit c9ff1ae80d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -124,8 +124,8 @@ func getDoc(filePath string) (string, error) {
// 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
maxSize = 10 * 1024 * 1024 // 10MB should be enough
initialSize = 4096 // same as startBufSize in bufio
)
scanner.Buffer(make([]byte, initialSize), maxSize)