forked from golang/hotime
This commit is contained in:
parent
9c730aae4d
commit
80c7f64162
@ -24,7 +24,11 @@ func Down(url, path, name string) bool {
|
|||||||
}
|
}
|
||||||
defer out.Close()
|
defer out.Close()
|
||||||
resp, err := http.Get(url)
|
resp, err := http.Get(url)
|
||||||
|
if err!=nil{
|
||||||
|
return false
|
||||||
|
}
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
|
|
||||||
pix, err := ioutil.ReadAll(resp.Body)
|
pix, err := ioutil.ReadAll(resp.Body)
|
||||||
_, err = io.Copy(out, bytes.NewReader(pix))
|
_, err = io.Copy(out, bytes.NewReader(pix))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user