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
What operating system and processor architecture are you using (go env)?
Windows 10 Pro x64 version 1703 (OS build 15063.483)
What did you do?
Code: https://play.golang.org/p/PlxIOWk271
It is a simple example dup3 from Kernighan Go book. I'm passing arguments one.txt and two.txt (files from archieve One version.zip) and gets such output: 2 Hello
Run command: go run main.go one.txt two.txt
But when I'm addnig simple '\n' escape sequence symbol (Version two.zip) in file one.txt, I'm getting such output: 2 Hello 2 me
Why didi I loose last line of file one.txt by reading by Scan() and Text() functions?
The text was updated successfully, but these errors were encountered:
This is very likely a bug in your program. If you're confident it isn't, please open an issue with a small program that reproduces the issue on play.golang.org.
Also note how the source code even notes how errors aren't checked.
mikioh
changed the title
Missed last line when read file by bufio.NewScanner(f).Scan()
bufio: Missed last line when read file by bufio.NewScanner(f).Scan()
Jul 21, 2017
What version of Go are you using (
go version
)?go version go1.8.3 windows/amd64
What operating system and processor architecture are you using (
go env
)?Windows 10 Pro x64 version 1703 (OS build 15063.483)
What did you do?
Code: https://play.golang.org/p/PlxIOWk271
It is a simple example dup3 from Kernighan Go book. I'm passing arguments one.txt and two.txt (files from archieve One version.zip) and gets such output:
2 Hello
Run command:
go run main.go one.txt two.txt
But when I'm addnig simple '\n' escape sequence symbol (Version two.zip) in file
one.txt
, I'm getting such output:2 Hello
2 me
Why didi I loose last line of file one.txt by reading by Scan() and Text() functions?
The text was updated successfully, but these errors were encountered: