Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

encoding/xml: incorrect EOF behavior in (*Decoder).Token #13757

Closed
alandonovan opened this issue Dec 28, 2015 · 6 comments
Closed

encoding/xml: incorrect EOF behavior in (*Decoder).Token #13757

alandonovan opened this issue Dec 28, 2015 · 6 comments
Milestone

Comments

@alandonovan
Copy link
Contributor

The docstring for (*Decoder).Token says "At the end of the input stream, Token returns nil, io.EOF", but when this program

http://play.golang.org/p/8pqgfMmPuU

is run using a tip (not Go 1.5) distribution, the resulting error is an *xml.SyntaxError.

This bug is causing the golang.org/x/tools/go/vcs tests to fail.

@alandonovan alandonovan changed the title encoding/xml: unclear spec for EOF in (*Decoder).Token encoding/xml: incorrect EOF behavior in (*Decoder).Token Dec 28, 2015
@dmitshur
Copy link
Contributor

This bug is causing the golang.org/x/tools/go/vcs tests to fail.

This part has been resolved independently (by resolving #13683 and applying that fix to x/tools/go/vcs in https://golang.org/cl/18196).

But the rest mentioned here ((*Decoder).Token documentation and behavior not matching) is still a valid (and unrelated) issue, right?

@alandonovan
Copy link
Contributor Author

Yes.

@bradfitz bradfitz added this to the Go1.6 milestone Jan 21, 2016
@bradfitz
Copy link
Contributor

Regression from Go 1.5.

@jhawk28
Copy link

jhawk28 commented Jan 22, 2016

The change to Token was made by this commit: bf21643

It may just need a documentation update.

@rsc
Copy link
Contributor

rsc commented Jan 24, 2016

Working as intended. CL 18854. Already mentioned in http://tip.golang.org/doc/go1.6. Note that "" is not a well-formed XML document: it is missing the "".

@gopherbot
Copy link

CL https://golang.org/cl/18854 mentions this issue.

@golang golang locked and limited conversation to collaborators Jan 23, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants