-
Notifications
You must be signed in to change notification settings - Fork 18k
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: Fscanln misbehaving and taking an extra rune #3833
Labels
Comments
(..yet more..) I should probably file a bug report for the behaviour of Scanln under the conditions above. ie entry of an even number of space separated single rune values. Skipping every other entry is understandable under these conditions (eaten rune), but the return of the same value twice isn't explicable/predictable. eg: entering "1 2 3 4 5" returns '1 3 5' - can understand - predictable from package documentation but entering 1 2 3 4 5 6" returns '1 3 5 5' - not predicted from docs. |
Labels changed: added priority-soon, packagebug, removed priority-triage. Owner changed to @robpike. Status changed to Accepted. |
If you get an error from Fscanln (or any other such function), you can't predict the state of the input. It could be anything. Fscanln reads a line and you're not giving it a line that matches the value[s] being read. You want to use fmt.Fscan for this kind of input or, if you know have three inputs, give three arguments. Status changed to WorkingAsIntended. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
by iJonCarroll:
The text was updated successfully, but these errors were encountered: