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 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@
// NOTE: May be called concurrently; synchronize access to shared memory.
m.Ack()
})
if err != context.Canceled {
if err != nil && != context.Canceled {

Check failure on line 306 in pubsub/example_test.go

View workflow job for this annotation

GitHub Actions / vet

expected operand, found '!='
// TODO: Handle error.
}
}
Expand All @@ -313,7 +313,7 @@
func ExampleSubscription_Receive_maxExtension() {
ctx := context.Background()
client, err := pubsub.NewClient(ctx, "project-id")
if err != nil {

Check failure on line 316 in pubsub/example_test.go

View workflow job for this annotation

GitHub Actions / vet

expected ';', found 'if'
// TODO: Handle error.
}
sub := client.Subscription("subName")
Expand All @@ -324,7 +324,7 @@
// TODO: Handle message.
m.Ack()
})
if err != context.Canceled {
if err != nil && != context.Canceled {

Check failure on line 327 in pubsub/example_test.go

View workflow job for this annotation

GitHub Actions / vet

expected operand, found '!='
// TODO: Handle error.
}
}
Expand All @@ -335,7 +335,7 @@
func ExampleSubscription_Receive_maxOutstanding() {
ctx := context.Background()
client, err := pubsub.NewClient(ctx, "project-id")
if err != nil {

Check failure on line 338 in pubsub/example_test.go

View workflow job for this annotation

GitHub Actions / vet

expected ';', found 'if'
// TODO: Handle error.
}
sub := client.Subscription("subName")
Expand All @@ -345,7 +345,7 @@
// TODO: Handle message.
m.Ack()
})
if err != context.Canceled {
if err != nil && != context.Canceled {

Check failure on line 348 in pubsub/example_test.go

View workflow job for this annotation

GitHub Actions / vet

expected operand, found '!='
// TODO: Handle error.
}
}
Expand All @@ -353,7 +353,7 @@
func ExampleSubscription_Update() {
ctx := context.Background()
client, err := pubsub.NewClient(ctx, "project-id")
if err != nil {

Check failure on line 356 in pubsub/example_test.go

View workflow job for this annotation

GitHub Actions / vet

expected ';', found 'if'
// TODO: Handle error.
}
sub := client.Subscription("subName")
Expand Down