mux_broker_test.go: range over chan for simplicity

This commit is contained in:
Adrien Delorme 2018-12-17 11:01:46 +01:00 committed by GitHub
parent 9a31d0de58
commit 2944030daf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 7 deletions

View File

@ -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())
}
}
}