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

fmt: Scanln doesn't stop at end of line when using a Scanner #1490

Closed
rogpeppe opened this issue Feb 10, 2011 · 2 comments
Closed

fmt: Scanln doesn't stop at end of line when using a Scanner #1490

rogpeppe opened this issue Feb 10, 2011 · 2 comments

Comments

@rogpeppe
Copy link
Contributor

From the docs: "Sscanln, Fscanln and Sscanln stop scanning at a newline and require
that the items be followed by one."

If one of the items implements Scanner, the scanning will only stop scanning at a newline
if the Scan method decides to.

either ScanState.ReadRune should return EOF when it gets to a newline in this case, or
it should be possible to find out from ScanState whether we're inside one of the *ln
functions.

i can see arguments both ways.
@rsc
Copy link
Contributor

rsc commented Feb 10, 2011

Comment 1:

Owner changed to r...@golang.org.

Status changed to Accepted.

@robpike
Copy link
Contributor

robpike commented Feb 24, 2011

Comment 2:

This issue was closed by revision 87fe958.

Status changed to Fixed.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
@minux minux changed the title Scanln doesn't stop at end of line when using a Scanner fmt: Scanln doesn't stop at end of line when using a Scanner Sep 27, 2016
@rsc rsc unassigned robpike Jun 22, 2022
This issue was closed.
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

4 participants