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
fmt: Scan returns "unexpected EOF" instead of io.EOF when arguments have a custom Scan method #17246
What version of Go are you using (
Thanks. I don't think it's a math/big problem, because I get io.ErrUnexpectedEOF with my own type too:
Here, my Scanner returns io.EOF, but fmt.Sscan changes it to io.ErrUnexpectedEOF. I don't understand the rationale behind this. Looking at the comments for the two error values, I feel that io.EOF is appropriate for my two examples because we're not encountering EOF in the middle of a data structure.