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:
parent
0f36b222f3
commit
7e73a97a41
1 changed files with 1 additions and 2 deletions
|
@ -87,11 +87,10 @@ func Devnull() (*net.UnixConn, error) {
|
||||||
go func() {
|
go func() {
|
||||||
defer priv.Close()
|
defer priv.Close()
|
||||||
for {
|
for {
|
||||||
payload, attachment, err := beam.Receive(priv)
|
_, attachment, err := beam.Receive(priv)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
fmt.Fprintf(os.Stderr, "[devnull] discarding '%s'\n", data.Message(string(payload)).Pretty())
|
|
||||||
if attachment != nil {
|
if attachment != nil {
|
||||||
attachment.Close()
|
attachment.Close()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue