Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
fmt: mishandling of FALSE in Scanf #2922
What steps will reproduce the problem? 1. Reading from stdin a bool value using fmt.Scanf with %t 2. Write FLLSE 3. It works?! What is the expected output? Not a boolean value but is evaluated as false. What do you see instead? A falsy value. Which compiler are you using (5g, 6g, 8g, gccgo)? 6g Which operating system are you using? Linux & Windows Which revision are you using? (hg identify) go version weekly.2011-12-22 11071 Please provide any additional information below. The error is located here http://code.google.com/p/go/source/browse/src/pkg/fmt/scan.go#515 That first accept should be s.accept("aA") instead of s.accept("aL")
I'm pretty sure there's a bug here, as pointed out: s/aL/aA/. My comment was about testing for the bug. I had a hard time writing a quick test that would break before applying the fix. I thought it would be a 1-minute job.
Owner changed to @robpike.
Status changed to Accepted.