From 79342f543614b767bc479867a75d2527d5c560a9 Mon Sep 17 00:00:00 2001 From: Hiromu OCHIAI Date: Thu, 7 Sep 2023 15:17:05 +0900 Subject: [PATCH] Do not acquire semaphore worker for directory --- copy.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/copy.go b/copy.go index 6b1510b..5fd1607 100644 --- a/copy.go +++ b/copy.go @@ -242,6 +242,9 @@ func dcopyConcurrent(srcdir, destdir string, contents []os.FileInfo, opt Options case <-opt.intent.ctx.Done(): return nil default: + if content.IsDir() { + return copyNextOrSkip(cs, cd, content, opt) + } if err := opt.intent.sem.Acquire(cancelctx, 1); err != nil { cancel() return err