mux_broker_test.go: defer close chan

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

View File

@ -20,18 +20,16 @@ func TestMuxBroker(t *testing.T) {
errChan := make(chan error, 1)
go func() {
defer close(errChan)
c, err := bc.Dial(5)
if err != nil {
errChan <- fmt.Errorf("err dialing: %s", err.Error())
close(errChan)
return
}
if _, err := c.Write([]byte{42}); err != nil {
errChan <- fmt.Errorf("err writing: %s", err.Error())
}
close(errChan)
}()
client, err := bs.Accept(5)