Merge pull request #2 from darknesto/master
Remove duplicated deferred call
This commit is contained in:
commit
20b1904f2d
1 changed files with 2 additions and 2 deletions
4
imdb.go
4
imdb.go
|
@ -129,7 +129,7 @@ func GetMovieByTitle(title string, year string) (*MovieResult, error) {
|
|||
|
||||
r := new(MovieResult)
|
||||
err = json.NewDecoder(resp.Body).Decode(r)
|
||||
defer resp.Body.Close()
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -149,7 +149,7 @@ func GetMovieByImdbId(id string) (*MovieResult, error) {
|
|||
|
||||
r := new(MovieResult)
|
||||
err = json.NewDecoder(resp.Body).Decode(r)
|
||||
defer resp.Body.Close()
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue