-
Notifications
You must be signed in to change notification settings - Fork 14
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
bufio: invalid use of UnreadByte #3
Comments
It works well at another PC, go1.11.4 windows/amd64, if it helps |
in UnreadByte code:
previous call is exactly Peek: xml-stream-parser/xmlparser.go Line 419 in 1b306d7
|
If change code to:
it works, but i do not know, how well. |
Can I make pull request with this? |
Hi @ramainen thanks for raising this issue. I realised that i was using 1.11 and Peek function has changed in 1.12 unfortunately we can't replace the peek with the readByte like in your pull request, in that way we might lost bytes. I am now reviewing and fixing the function that use Peek using 1.12. Let me know if you have suggestions. |
I fixed the function now seems that working with both 1.11 and 1.12 |
Hopefully now fixed with parser version v1.14 |
So fast, thank you |
go version go1.12.5 windows/amd64
xml-stream-parser: latest ("Skip XML declatarions at beginning" commit)
There is error while try to use Stream(),
for xml := range parserXML.Stream() {
xml.Err.Error() contains "Invalid xml"
I checked out, there is sendError() method shows this, and error actually contains "bufio: invalid use of UnreadByte".
He sterted at here: https://github.com/tamerh/xml-stream-parser/blob/master/xmlparser.go#L453
and before at here:
xml-stream-parser/xmlparser.go
Line 540 in 1b306d7
Next is bufio itself.
The text was updated successfully, but these errors were encountered: