Skip to content

Commit

Permalink
Copy directly to os.Stdout instead
Browse files Browse the repository at this point in the history
Closes: #76 [via git-merge-pr]
  • Loading branch information
Jacalz authored and psanford committed May 24, 2022
1 parent f024309 commit 7b8c990
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cmd/recv.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,15 @@ func recvAction(cmd *cobra.Command, args []string) {

switch msg.Type {
case wormhole.TransferText:
body, err := ioutil.ReadAll(msg)
_, err := io.Copy(os.Stdout, msg)
if err != nil {
log.Fatal(err)
}

fmt.Println(string(body))
_, err = os.Stdout.WriteString("\n")
if err != nil {
log.Fatal(err)
}
case wormhole.TransferFile:
var acceptFile bool
if _, err := os.Stat(msg.Name); err == nil {
Expand Down

0 comments on commit 7b8c990

Please sign in to comment.