1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-26 03:01:28 +00:00

Remove some unnecessary code

This commit is contained in:
smallfish 2014-08-17 21:13:29 +08:00
parent 1f1190fbc3
commit d27c5c8daf

View File

@ -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.