Skip to content

Commit 7b360d2

Browse files
committed
WithTimeout returns one more value, cancel
1 parent ff6e986 commit 7b360d2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

articles/event-hubs/event-hubs-go-get-started-send.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: 'Quickstart: Send and receive events using Go - Azure Event Hubs'
33
description: 'Quickstart: This article provides a walkthrough for creating a Go application that sends events from Azure Event Hubs.'
44
ms.topic: quickstart
5-
ms.date: 09/23/2021
5+
ms.date: 11/11/2021
66
---
77

88
# Quickstart: Send events to or receive events from Event Hubs using Go
@@ -75,7 +75,7 @@ The following code creates an Event Hubs client:
7575

7676
```go
7777
hub, err := eventhubs.NewHub("namespaceName", "hubName", tokenProvider)
78-
ctx := context.WithTimeout(context.Background(), 10 * time.Second)
78+
ctx, cancel := context.WithTimeout(context.Background(), 10 * time.Second)
7979
defer hub.Close(ctx)
8080
if err != nil {
8181
log.Fatalf("failed to get hub %s\n", err)

0 commit comments

Comments
 (0)