From d27c5c8daf715b92cd2e61062d89cce802370d2c Mon Sep 17 00:00:00 2001 From: smallfish Date: Sun, 17 Aug 2014 21:13:29 +0800 Subject: [PATCH] Remove some unnecessary code --- httplib/httplib.go | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/httplib/httplib.go b/httplib/httplib.go index 53b8e6ca..ca012502 100644 --- a/httplib/httplib.go +++ b/httplib/httplib.go @@ -395,10 +395,7 @@ func (b *BeegoHttpRequest) ToFile(filename string) error { } defer resp.Body.Close() _, err = io.Copy(f, resp.Body) - if err != nil { - return err - } - return nil + return err } // ToJson returns the map that marshals from the body bytes as json in response . @@ -409,10 +406,7 @@ func (b *BeegoHttpRequest) ToJson(v interface{}) error { return err } err = json.Unmarshal(data, v) - if err != nil { - return err - } - return nil + return err } // ToXml returns the map that marshals from the body bytes as xml in response . @@ -423,10 +417,7 @@ func (b *BeegoHttpRequest) ToXML(v interface{}) error { return err } err = xml.Unmarshal(data, v) - if err != nil { - return err - } - return nil + return err } // Response executes request client gets response mannually.