turn Advise structure in idiomatic go code

This commit is contained in:
Marcelo Pires
2018-09-07 17:50:16 +02:00
parent 66218f4616
commit 0fce9349d0
4 changed files with 88 additions and 24 deletions

View File

@ -124,9 +124,13 @@ func TestSubscribeUnauthorizedChannel(t *testing.T) {
}
_, err = client.Subscribe("/unauthorized")
if err.Error() != unauthorizedErr.Error() {
t.Fatalf("expecting `500::unauthorized channel` got : `%s`", err.Error())
if err != nil {
if err.Error() != unauthorizedErr.Error() {
t.Fatalf("expecting `500::unauthorized channel` got : `%s`", err.Error())
}
return
}
log.Println(err)
t.Fatal("expecting error")
}