You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
dtam-cybozu
changed the title
pubsub: example for Subscription.Receive is incorect
pubsub: docs example for Subscription.Receive is incorect
Nov 27, 2023
Client
PubSub
Environment
N/A
Go Environment
N/A
Code
According to this example https://github.com/googleapis/google-cloud-go/blob/main/pubsub/example_test.go#L313-L329 we are supposed to assume that something has gone wrong if
err != context.Canceled
but I had a very quick skim through theReceive
source and it seems like it often returnsnil
(notably, including when ctx is done).Expected behavior
I'm not exactly sure if
Receive()
ever returnscontext.Canceled
so I can't say whether the condition should look like:but it should at least look like this if I'm not mistaken:
Please let me know if I've made a mistake, thanks :)
The text was updated successfully, but these errors were encountered: