This commit is contained in:
hoteas 2017-12-01 07:33:19 +00:00
parent 9c730aae4d
commit 80c7f64162

View File

@ -24,7 +24,11 @@ func Down(url, path, name string) bool {
}
defer out.Close()
resp, err := http.Get(url)
if err!=nil{
return false
}
defer resp.Body.Close()
pix, err := ioutil.ReadAll(resp.Body)
_, err = io.Copy(out, bytes.NewReader(pix))
if err != nil {