Remap EOF to ErrUnexpectedEOF now we're checking for end of stream.

This commit is contained in:
Matt Goodall 2012-07-09 15:04:57 +01:00
parent 6b01a7f10c
commit b752357c8d
1 changed files with 3 additions and 0 deletions

View File

@ -104,6 +104,9 @@ func (stream *Stream) Next(match *xml.Name) (*xml.StartElement, error) {
for {
t, err := stream.dec.Token()
if err != nil {
if err == io.EOF {
err = io.ErrUnexpectedEOF
}
return nil, err
}
switch e := t.(type) {