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

Commit

Permalink
Fix window environment channel closing bug (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
leonwind authored May 5, 2022
1 parent 4f0aa27 commit 4458735
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 1 addition & 0 deletions cli/cli2cloud/cli2cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 0 additions & 2 deletions cli/cli2cloud/streams/collectStreams.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ func readFromStreams(messages chan string, f *os.File) {
row := scanner.Text()
messages <- row
}

close(messages)
}

func CreateStreams(messages chan string) {
Expand Down

0 comments on commit 4458735

Please sign in to comment.