FAQ

On 2013/4/5 Robert Clausecker wrote:

Testing reveals that appending a dummy %c to the end of the formatting
string consumes a character that may or may not be pushed back otherwise
reliably. As I read the documentation this is still no guarantee that
this may change in future versions as the specification is a bit vague
on what formatting specifiers require a lookahead char.

It would be nice if somebody could confirm if the current behavior is
implementation defined or not. If not, how can I resolve this issue
without relying on implementation defined behavior?
You can read the line into a buffer, as a first step (using
bufio.Reader.ReadBytes/ReadSlice for example), then use fmt.Fscanf on
a bytes.Reader set to read this line.

Rémy.

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Discussion Posts

Previous

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 2 | next ›
Discussion Overview
groupgolang-nuts @
categoriesgo
postedApr 5, '13 at 8:33p
activeApr 5, '13 at 8:49p
posts2
users2
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase