From 491a094e0742c0d506dd8bf16af4f9c12b91fa92 Mon Sep 17 00:00:00 2001 From: Yasuhiro Matsumoto Date: Sat, 23 Nov 2024 17:33:01 +0900 Subject: [PATCH] close ch --- helpers.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/helpers.go b/helpers.go index f84967f..6cf5908 100644 --- a/helpers.go +++ b/helpers.go @@ -70,7 +70,9 @@ func getStdinLinesOrArgumentsFromSlice(args []string) chan string { // try the stdin multi := make(chan string) - writeStdinLinesOrNothing(multi) + if !writeStdinLinesOrNothing(multi) { + close(multi) + } return multi }