From 2ac2807916fbf36e1fce5726ac102ab66f14d4ad Mon Sep 17 00:00:00 2001 From: Nick White Date: Wed, 19 May 2021 22:27:37 +0100 Subject: Close process channel after writing to err channel in download(), in case of an error This is needed so that in tests the error can be selected out reliably, rather than an empty process signal. --- internal/pipeline/pipeline.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'internal') diff --git a/internal/pipeline/pipeline.go b/internal/pipeline/pipeline.go index 5ba0cb4..72d7fd1 100644 --- a/internal/pipeline/pipeline.go +++ b/internal/pipeline/pipeline.go @@ -87,8 +87,8 @@ func download(dl chan string, process chan string, conn Pipeliner, dir string, e if err != nil { for range dl { } // consume the rest of the receiving channel so it isn't blocked - close(process) errc <- err + close(process) return } process <- fn -- cgit v1.2.1-24-ge1ad