Skip to content

Commit

Permalink
recvtty: use ioutil.Discard
Browse files Browse the repository at this point in the history
Saves us a few lines of code.

Signed-off-by: Kir Kolyshkin <[email protected]>
  • Loading branch information
kolyshkin committed Nov 30, 2020
1 parent 7cfb3dc commit 1c0143d
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions contrib/cmd/recvtty/recvtty.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,7 @@ func handleNull(path string) error {
return
}

// Just do a dumb copy to /dev/null.
devnull, err := os.OpenFile("/dev/null", os.O_RDWR, 0)
if err != nil {
// TODO: Handle this nicely.
return
}

io.Copy(devnull, master)
devnull.Close()
io.Copy(ioutil.Discard, master)
}(conn)
}
}
Expand Down

0 comments on commit 1c0143d

Please sign in to comment.