diff --git a/pubsub/azuresb/azuresb_test.go b/pubsub/azuresb/azuresb_test.go index 4d85823449..65d9d3112d 100644 --- a/pubsub/azuresb/azuresb_test.go +++ b/pubsub/azuresb/azuresb_test.go @@ -343,9 +343,7 @@ func BenchmarkAzureServiceBusPubSub(b *testing.B) { if err != nil { b.Fatal(err) } - } - - if sbHostname != "" { + } else if sbHostname != "" { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { b.Fatal(err)