-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Labels
Milestone
Description
http://play.golang.org/p/WlMpKiMGIv fails but if the format for the integer is %d rather than %5d, it works fine.
Snippet here reproduced here for clarity:
package main
import "fmt"
func main() {
format := "%6s%5d"
// "ssssssddddd"
line := "some 3"
var str string
var numb int64
n, err := fmt.Sscanf(line, format, &str, &numb)
fmt.Println(n, err)
fmt.Println(str, numb)
}
The use of widths vs. space-separated tokens confuses. It's possible this is working as intended but if so it needs to be explained. I believe it's a bug.