You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The expected output is line length, the actual output is 0. golang-issue.txt is file with single very long line. If the line is 65536 or less this code works ok, if it has more characters, the code fails.
Surprisingly, the second call to Scan() returns the complete line.
go version go1.4.2 darwin/amd64
OSX 10.10.3 (14D136)
Program is started as follows: go fmt golang-issue.go && go run golang-issue.go < golang-issue.txt
The text was updated successfully, but these errors were encountered:
mikioh
changed the title
ScanLines from bufio does not scan os.Stdin if line is more than 65536 chars
bufio: ScanLines does not scan os.Stdin if line is more than 65536 chars
Jun 17, 2015
The following code fails to read the line passed to stdin if the line is more too long:
The expected output is line length, the actual output is 0.
golang-issue.txt
is file with single very long line. If the line is 65536 or less this code works ok, if it has more characters, the code fails.Surprisingly, the second call to Scan() returns the complete line.
go fmt golang-issue.go && go run golang-issue.go < golang-issue.txt
The text was updated successfully, but these errors were encountered: