diff --git a/cli/cli2cloud/cli2cloud.go b/cli/cli2cloud/cli2cloud.go index eb43621..db6ff6f 100644 --- a/cli/cli2cloud/cli2cloud.go +++ b/cli/cli2cloud/cli2cloud.go @@ -70,6 +70,7 @@ func sendPipedMessages(c proto.Cli2CloudClient, ctx context.Context, password *s // Create a messages stream which is reading from both Stdout and Stdin streamMessages := make(chan string) + defer close(streamMessages) go streams.CreateStreams(streamMessages) for row := range streamMessages { diff --git a/cli/cli2cloud/streams/collectStreams.go b/cli/cli2cloud/streams/collectStreams.go index 859095c..58eefce 100644 --- a/cli/cli2cloud/streams/collectStreams.go +++ b/cli/cli2cloud/streams/collectStreams.go @@ -11,8 +11,6 @@ func readFromStreams(messages chan string, f *os.File) { row := scanner.Text() messages <- row } - - close(messages) } func CreateStreams(messages chan string) {