go-flickr
go-flickr copied to clipboard
Close bug
hello,here is a bug,if err is not nil, then defer res.Body.Close(),will panic. `func (request *Request) Execute() (response string, ret error) { if request.ApiKey == "" || request.Method == "" { return "", Error("Need both API key and method") }
s := request.URL()
res, err := http.Get(s)
defer res.Body.Close()
if err != nil {
return "", err
}
body, _ := ioutil.ReadAll(res.Body)
return string(body), nil
}`