From a816f9e9dbf820d7d01e8d363539da976fb8aa40 Mon Sep 17 00:00:00 2001 From: Weilin Shi <934587911@qq.com> Date: Thu, 21 Dec 2017 11:00:17 +0800 Subject: [PATCH] Remove redundant if err != nil check (#1202) * Remove redundant if err != nil check * Return e.EncodeToken instead of create a new variable --- render/render_test.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/render/render_test.go b/render/render_test.go index e4df5b6d..35662cf3 100644 --- a/render/render_test.go +++ b/render/render_test.go @@ -111,10 +111,8 @@ func (h xmlmap) MarshalXML(e *xml.Encoder, start xml.StartElement) error { return err } } - if err := e.EncodeToken(xml.EndElement{Name: start.Name}); err != nil { - return err - } - return nil + + return e.EncodeToken(xml.EndElement{Name: start.Name}) } func TestRenderXML(t *testing.T) {