Skip to content
This repository was archived by the owner on Aug 10, 2024. It is now read-only.

Commit 4458735

Browse files
authored
Fix window environment channel closing bug (#28)
1 parent 4f0aa27 commit 4458735

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

cli/cli2cloud/cli2cloud.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ func sendPipedMessages(c proto.Cli2CloudClient, ctx context.Context, password *s
7070

7171
// Create a messages stream which is reading from both Stdout and Stdin
7272
streamMessages := make(chan string)
73+
defer close(streamMessages)
7374
go streams.CreateStreams(streamMessages)
7475

7576
for row := range streamMessages {

cli/cli2cloud/streams/collectStreams.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ func readFromStreams(messages chan string, f *os.File) {
1111
row := scanner.Text()
1212
messages <- row
1313
}
14-
15-
close(messages)
1614
}
1715

1816
func CreateStreams(messages chan string) {

0 commit comments

Comments
 (0)