beam/examples/beamsh: don't print discarded messages in Devnull

This avoids false alarms when process exits without printing. Devnull
doesn't require synchronization.

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
This commit is contained in:
Solomon Hykes 2014-03-26 15:47:05 -07:00
parent 0f36b222f3
commit 7e73a97a41

View file

@ -87,11 +87,10 @@ func Devnull() (*net.UnixConn, error) {
go func() {
defer priv.Close()
for {
payload, attachment, err := beam.Receive(priv)
_, attachment, err := beam.Receive(priv)
if err != nil {
return
}
fmt.Fprintf(os.Stderr, "[devnull] discarding '%s'\n", data.Message(string(payload)).Pretty())
if attachment != nil {
attachment.Close()
}