From 43232d9661435b007bfe05f0e6d81ca1bb755baf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=87=8C=E6=B5=B7=E4=BB=B2=E5=AD=90?= Date: Fri, 3 Sep 2021 22:36:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=88=9B=E5=BB=BA=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E6=97=B6=E6=89=93=E5=8D=B0=E9=94=99=E8=AF=AF=E5=86=85?= =?UTF-8?q?=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 0dc9989..83e4ec9 100644 --- a/main.go +++ b/main.go @@ -79,7 +79,7 @@ func downloadFile(client http.Client, path, filename string, wg *sync.WaitGroup) // 创建文件 file, err := os.Create(filepath.Join(path, filename)) if err != nil { - fmt.Printf("create file: %s error\n", filename) + fmt.Printf("create file %s error: %s\n", filename, err.Error()) return } defer file.Close() @@ -91,7 +91,7 @@ func downloadFile(client http.Client, path, filename string, wg *sync.WaitGroup) file.Write(buff[:n]) break } - fmt.Println("error: ", err) + fmt.Println("error: ", err.Error()) os.Remove(filepath.Join(path, filename)) return }