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
What does 'go version' print? go version go1.3 linux/amd64
What steps reproduce the problem?
Example here: http://play.golang.org/p/H-KFkROfOJ
1. Call fmt.Sscanf("Hello", "%s", &x) where x implements Scanner.
2. Within x's Scan() function, call r, n, err := state.ReadRune().
What happened?
ReadRune() returns 'H', 0, nil
What should have happened instead?
ReadRune() should have returned 'H', 1, nil
Please provide any additional information below.
pkg/fmt/scan.go contains this code:
356 func (r *readRune) ReadRune() (rr rune, size int, err error) {
357 r.buf[0], err = r.readByte()
358 if err != nil {
359 return 0, 0, err
360 }
361 if r.buf[0] < utf8.RuneSelf { // fast check for common ASCII case
362 rr = rune(r.buf[0])
363 return
364 }
The fast case needs to set the size, e.g.:
size = utf8.RuneLen(rr)
The text was updated successfully, but these errors were encountered:
by kwalsh@holycross.edu:
The text was updated successfully, but these errors were encountered: