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
I expect an empty string not an error, is this intentional?
The text was updated successfully, but these errors were encountered:
mikioh
changed the title
fmt.Scanln returns "unexpected newline" error on an empty line
fmt: Scanln returns "unexpected newline" error on an empty line
Jan 22, 2015
Scanln stops scanning at the newline (or EOF) but otherwise scans space-separated values. There are 0 space-separated values on an empty line (since arbitrary many "empty strings" makes no sense). If you call fmt.Scanln() just like this (w/ no arguments), then you won't get an error since you're not expecting anything. If you call it with more than one argument, than you have to provide an appropriate number of non-empty input values which are space-separated. If you want an empty string, provide an empty string "".
This is working as intended.
Next time, please leave a complete example so the context is clear (a reader has to guess the arguments you may or may not have provided).
Also, next time, please don't use the issue tracker to ask questions - that's what the go-nuts mailing list is for.
I expect an empty string not an error, is this intentional?
The text was updated successfully, but these errors were encountered: