Skip to content

Commit 5d4fd20

Browse files
authored
Added defer sender.Close(context.TODO()) in SendMessageBatch function
Added defer sender.Close(context.TODO()) in SendMessageBatch function
1 parent 4573049 commit 5d4fd20

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

articles/service-bus-messaging/service-bus-go-how-to-use-queues.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ func SendMessageBatch(messages []string, client *azservicebus.Client) {
109109
if err != nil {
110110
panic(err)
111111
}
112-
112+
defer sender.Close(context.TODO())
113+
113114
batch, err := sender.NewMessageBatch(context.TODO(), nil)
114115
if err != nil {
115116
panic(err)

0 commit comments

Comments
 (0)