Golang

ScanLines limit bytes in Golang

When working with bufio.ScanLines for retrieving text from file per say, if the string in line exceed default Scan (64K), then we cannot get the full line.

To overcome this problem, simply set maxCapacity to the scan.

In this example we set the maxCapacity to 512MB.

Hope this helps!!

PEACE!!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store