Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(pubsub): check for nil responses for receive examples #9516

Merged
merged 2 commits into from
Mar 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions pubsub/example_test.go
Expand Up @@ -303,7 +303,7 @@ func ExampleSubscription_Receive() {
// NOTE: May be called concurrently; synchronize access to shared memory.
m.Ack()
})
if err != context.Canceled {
if err != nil && err != context.Canceled {
// TODO: Handle error.
}
}
Expand All @@ -324,7 +324,7 @@ func ExampleSubscription_Receive_maxExtension() {
// TODO: Handle message.
m.Ack()
})
if err != context.Canceled {
if err != nil && err != context.Canceled {
// TODO: Handle error.
}
}
Expand All @@ -345,7 +345,7 @@ func ExampleSubscription_Receive_maxOutstanding() {
// TODO: Handle message.
m.Ack()
})
if err != context.Canceled {
if err != nil && err != context.Canceled {
// TODO: Handle error.
}
}
Expand Down