Skip to content

Commit

Permalink
fix error handling in encoder
Browse files Browse the repository at this point in the history
  • Loading branch information
clbanning committed Feb 2, 2021
1 parent 0f0a447 commit 2ee132b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions anyxml.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ func Xml(v interface{}, rootTag ...string) ([]byte, error) {
for {
_, err = d.Token()
if err == io.EOF {
err = nil
break
} else if err != nil {
return nil, err
Expand Down Expand Up @@ -209,6 +210,7 @@ func XmlIndent(v interface{}, prefix, indent string, rootTag ...string) ([]byte,
for _, err = d.Token(); err != io.EOF; {
_, err = d.Token()
if err == io.EOF {
err = nil
break
} else if err != nil {
return nil, err
Expand Down

0 comments on commit 2ee132b

Please sign in to comment.