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: Sscanf doc disagrees with implementation #12788
However, in the current implementation, trailing newlines in the format string are treated as matching the end of the input string:
Either the package documentation or the implementation should be updated. (Probably the package documentation, since a significant number of programs are likely already relying on this behavior.)
Yes, that's the point. According to the documentation, fmt.Sscanf should return an error in this case (as it does for, say, http://play.golang.org/p/T1_RAgYLC-).
That is: according to the documentation, the newline in the format string should require a corresponding newline in the input string in order to return a nil error. It currently does not.