mirror of
https://github.com/jackc/pgx.git
synced 2025-04-27 13:14:32 +00:00
Correct WaitForNotification example
While working on a project that was using this, I tried using the example code but instead found that WaitForNotification expects a Context (which makes sense). This corrects the docs for folks using that as a jumping off point.
This commit is contained in:
parent
652d695065
commit
50b92ce0f5
2
doc.go
2
doc.go
@ -225,7 +225,7 @@ notification.
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if notification, err := conn.WaitForNotification(time.Second); err != nil {
|
if notification, err := conn.WaitForNotification(context.TODO()); err != nil {
|
||||||
// do something with notification
|
// do something with notification
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user