Merge pull request #748 from smallfish/master
Remove some unnecessary code
Showing
1 changed file
with
0 additions
and
9 deletions
| ... | @@ -394,10 +394,7 @@ func (b *BeegoHttpRequest) ToFile(filename string) error { | ... | @@ -394,10 +394,7 @@ func (b *BeegoHttpRequest) ToFile(filename string) error { |
| 394 | } | 394 | } |
| 395 | defer resp.Body.Close() | 395 | defer resp.Body.Close() |
| 396 | _, err = io.Copy(f, resp.Body) | 396 | _, err = io.Copy(f, resp.Body) |
| 397 | if err != nil { | ||
| 398 | return err | 397 | return err |
| 399 | } | ||
| 400 | return nil | ||
| 401 | } | 398 | } |
| 402 | 399 | ||
| 403 | // ToJson returns the map that marshals from the body bytes as json in response . | 400 | // 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 { | ... | @@ -408,10 +405,7 @@ func (b *BeegoHttpRequest) ToJson(v interface{}) error { |
| 408 | return err | 405 | return err |
| 409 | } | 406 | } |
| 410 | err = json.Unmarshal(data, v) | 407 | err = json.Unmarshal(data, v) |
| 411 | if err != nil { | ||
| 412 | return err | 408 | return err |
| 413 | } | ||
| 414 | return nil | ||
| 415 | } | 409 | } |
| 416 | 410 | ||
| 417 | // ToXml returns the map that marshals from the body bytes as xml in response . | 411 | // 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 { | ... | @@ -422,10 +416,7 @@ func (b *BeegoHttpRequest) ToXML(v interface{}) error { |
| 422 | return err | 416 | return err |
| 423 | } | 417 | } |
| 424 | err = xml.Unmarshal(data, v) | 418 | err = xml.Unmarshal(data, v) |
| 425 | if err != nil { | ||
| 426 | return err | 419 | return err |
| 427 | } | ||
| 428 | return nil | ||
| 429 | } | 420 | } |
| 430 | 421 | ||
| 431 | // Response executes request client gets response mannually. | 422 | // Response executes request client gets response mannually. | ... | ... |
-
Please register or sign in to post a comment