From c07a77034a0436ea98613623d1ab6511ad88ce6d Mon Sep 17 00:00:00 2001 From: Rose Hogenson Date: Tue, 15 Apr 2025 07:18:47 -0700 Subject: Don't wait for size calculation This can sometimes cause the progress bar not to render, but it also prevents a mysterious lag on exit if the size calculation ends up taking longer than the copy itself --- internal/cp/cp.go | 3 --- 1 file changed, 3 deletions(-) (limited to 'internal/cp/cp.go') diff --git a/internal/cp/cp.go b/internal/cp/cp.go index 2558419..da164f4 100644 --- a/internal/cp/cp.go +++ b/internal/cp/cp.go @@ -201,12 +201,9 @@ func (c *copier) copySymlink(src FSPath, dst FSPath) error { // interface. If force is specified and an existing destination file cannot be // opened, Copy will remove it and try again. func Copy(progress Progress, srcs []FSPath, dstRoot FSPath, force bool) { - done := make(chan struct{}) go func() { - defer close(done) progress.Max(size(srcs)) }() - defer func() { <-done }() dstIsDir := true if len(srcs) == 1 { -- cgit v1.3.1