diff --git a/httplib/httplib.go b/httplib/httplib.go index e60ac7ac..7bd7e743 100644 --- a/httplib/httplib.go +++ b/httplib/httplib.go @@ -394,10 +394,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 . @@ -408,10 +405,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 . @@ -422,10 +416,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.