diff --git a/helpers.go b/helpers.go index 3b8f015..9a7e27e 100644 --- a/helpers.go +++ b/helpers.go @@ -69,8 +69,13 @@ func writeStdinLinesOrNothing(ch chan string) (hasStdinLines bool) { go func() { scanner := bufio.NewScanner(os.Stdin) scanner.Buffer(make([]byte, 16*1024), 256*1024) + hasEmittedAtLeastOne := false for scanner.Scan() { ch <- strings.TrimSpace(scanner.Text()) + hasEmittedAtLeastOne = true + } + if !hasEmittedAtLeastOne { + ch <- "" } close(ch) }()