From 575f98911bf6b621dc892b5b3e50fd84f83da584 Mon Sep 17 00:00:00 2001 From: cnbattle Date: Fri, 5 Mar 2021 16:50:58 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=B9=B6=E5=8F=91=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E4=B8=A2=E5=A4=B1=E6=96=87=E4=BB=B6=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- upcloud.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/upcloud.go b/upcloud.go index 0547d536..d60479a1 100644 --- a/upcloud.go +++ b/upcloud.go @@ -39,14 +39,19 @@ func main() { var wg sync.WaitGroup for _, file := range files { wg.Add(1) - _ = pool.Submit(func() { - err := commInterface.Upload(file.Local, file.UpKey) + local := file.Local + upKey := file.UpKey + err = pool.Submit(func() { + err := commInterface.Upload(local, upKey) if err != nil { fmt.Println("commInterface.Upload error:", err) } fmt.Print(".") wg.Done() }) + if err != nil { + fmt.Println("pool.Submit error:", err) + } } wg.Wait() fmt.Println()