From 2944030daf4d52284ab66d1084b07683aa42d885 Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Mon, 17 Dec 2018 11:01:46 +0100 Subject: [PATCH] mux_broker_test.go: range over chan for simplicity --- packer/rpc/mux_broker_test.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/packer/rpc/mux_broker_test.go b/packer/rpc/mux_broker_test.go index 9d6aeee75..fe0a6118a 100644 --- a/packer/rpc/mux_broker_test.go +++ b/packer/rpc/mux_broker_test.go @@ -46,13 +46,9 @@ func TestMuxBroker(t *testing.T) { t.Fatalf("bad: %d", data[0]) } - for { - err, open := <-errChan - if !open { - if err != nil { - t.Fatalf(err.Error()) - } - break + for err := range errChan { + if err != nil { + t.Fatalf(err.Error()) } } }