read from ErrorsCh also

This commit is contained in:
Anton Kaliaev 2017-03-09 17:44:00 +04:00
parent 05e1a22d5b
commit 720b74d89e
No known key found for this signature in database
GPG Key ID: 7B6881D965918214

View File

@ -140,7 +140,8 @@ func testWS(t *testing.T, cl *client.WSClient) {
t.Fatal(err) t.Fatal(err)
} }
msg := <-cl.ResultsCh select {
case msg := <-cl.ResultsCh:
result := new(Result) result := new(Result)
wire.ReadJSONPtr(result, msg, &err) wire.ReadJSONPtr(result, msg, &err)
if err != nil { if err != nil {
@ -150,6 +151,9 @@ func testWS(t *testing.T, cl *client.WSClient) {
if got != val { if got != val {
t.Fatalf("Got: %v .... Expected: %v \n", got, val) t.Fatalf("Got: %v .... Expected: %v \n", got, val)
} }
case err := <-cl.ErrorsCh:
t.Fatal(err)
}
} }
//------------- //-------------