On Sun, Jul 12, 2020 at 10:42 PM Gobin Sougrakpam
wrote:
>
> I encountered this error but was able to fix it after setting the
> scanner.Buffer size to a rather large number.
>
> bufio.Scanner: token too long
...
> Now, the question is when I run this function successfully, the first token
> t
Hi Folks,
I encountered this error but was able to fix it after setting the
scanner.Buffer size to a rather large number.
*bufio.Scanner: token too long*
Here is my fixed function:
func scanFile(f *os.File) error {
scanner := bufio.NewScanner(f)
scanner.Buffer(make([]byte, 0, 819200), 819200)