Closed 0tarof closed 2 years ago
Thanks for opening PR. I'll review it later.
Because os hard limit of bufio.Scanner.
I don't know about that. 😓
bufio.Scanner has default token size defained at bufio.MaxScanToken. Ref: https://cs.opensource.google/go/go/+/refs/tags/go1.17.5:src/bufio/scan.go;l=81;bpv=1;bpt=1
if line length is greater than maxTokenSize, then Scanner.Scan function is failed with bufio.ErrTooLong.
In my case, gomockhandler scans large json configuration file on directory tree, then the command failed with that error.
gomockhandler check
is failed when scan the large single line file. Because ~os~ of hard limit of bufio.Scanner.So use bufio.Reader to scan first line of file.
P.S. There is another approach like filtering target files using extension, etc...