Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

text/scanner: Can't properly detect EOF from os.Stdin #10735

Closed
owenthereal opened this issue May 7, 2015 · 2 comments
Closed

text/scanner: Can't properly detect EOF from os.Stdin #10735

owenthereal opened this issue May 7, 2015 · 2 comments
Milestone

Comments

@owenthereal
Copy link

  • What version of Go are you using (go version)?
$ go version
go version go1.4.2 darwin/amd64
  • What operating system and processor architecture are you using?

OSX 64bit.

  • What did you do?

I tried to use scanner.Scanner from text/scanner from os.Stdin and I pressed ctrl+D to send a EOF to the program. The program couldn't properly detect EOF. Reference code.

  • What did you expect to see?

The program should stop immediately I sent the EOF (ctrl+D).

  • What did you see instead?

The program hung there. Pressing ctrl+D multiple times did stop the program.

@robpike
Copy link
Contributor

robpike commented May 7, 2015

A second ^D works. This is always a notorious problem due to lookahead, but it would be good to fix.

@owenthereal
Copy link
Author

👍 to the fixes

@mikioh mikioh added this to the Go1.5 milestone May 23, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants