Remove redundant if err != nil check (#1202)

* Remove redundant if err != nil check

* Return e.EncodeToken instead of create a new variable
This commit is contained in:
Weilin Shi 2017-12-21 11:00:17 +08:00 committed by Bo-Yi Wu
parent 05547037e4
commit a816f9e9db
1 changed files with 2 additions and 4 deletions

View File

@ -111,10 +111,8 @@ func (h xmlmap) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
return err return err
} }
} }
if err := e.EncodeToken(xml.EndElement{Name: start.Name}); err != nil {
return err return e.EncodeToken(xml.EndElement{Name: start.Name})
}
return nil
} }
func TestRenderXML(t *testing.T) { func TestRenderXML(t *testing.T) {